@naturali/cli 0.47.1 → 0.48.1
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 +925 -327
- 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.48.1";
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region ../sdk/src/generated/core/bodySerializer.gen.ts
|
|
20
20
|
const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
|
|
@@ -620,6 +620,272 @@ const createClient = (config = {}) => {
|
|
|
620
620
|
const client = createClient(createConfig());
|
|
621
621
|
//#endregion
|
|
622
622
|
//#region ../sdk/src/generated/sdk.gen.ts
|
|
623
|
+
var Channels = class {
|
|
624
|
+
/**
|
|
625
|
+
* List addresses
|
|
626
|
+
*/
|
|
627
|
+
static listAddresses(options) {
|
|
628
|
+
return (options.client ?? client).get({
|
|
629
|
+
url: "/v1/projects/{project_id}/addresses",
|
|
630
|
+
...options
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Erase an address
|
|
635
|
+
*
|
|
636
|
+
* Removes the address, its conversations, and its runtime actor and sessions.
|
|
637
|
+
*
|
|
638
|
+
*/
|
|
639
|
+
static deleteAddress(options) {
|
|
640
|
+
return (options.client ?? client).delete({
|
|
641
|
+
url: "/v1/projects/{project_id}/addresses/{identifier}",
|
|
642
|
+
...options
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Get an address
|
|
647
|
+
*/
|
|
648
|
+
static getAddress(options) {
|
|
649
|
+
return (options.client ?? client).get({
|
|
650
|
+
url: "/v1/projects/{project_id}/addresses/{identifier}",
|
|
651
|
+
...options
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Set or clear this address's own action
|
|
656
|
+
*
|
|
657
|
+
* Upserts the address and its `action` in one call. `action: null` forgets the exception and defers back to the route table; any other `action` requires the same fields a route or channel default would (`agent_id` for `agent`, `text` for `message`).
|
|
658
|
+
*
|
|
659
|
+
*/
|
|
660
|
+
static setAddressAction(options) {
|
|
661
|
+
return (options.client ?? client).put({
|
|
662
|
+
url: "/v1/projects/{project_id}/addresses/{identifier}",
|
|
663
|
+
...options,
|
|
664
|
+
headers: {
|
|
665
|
+
"Content-Type": "application/json",
|
|
666
|
+
...options.headers
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* List an address's conversations
|
|
672
|
+
*
|
|
673
|
+
* Every conversation this address has had, across every channel it has ever messaged — an address is project-scoped, not channel-scoped.
|
|
674
|
+
*
|
|
675
|
+
*/
|
|
676
|
+
static listAddressConversations(options) {
|
|
677
|
+
return (options.client ?? client).get({
|
|
678
|
+
url: "/v1/projects/{project_id}/addresses/{identifier}/conversations",
|
|
679
|
+
...options
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* List channel kinds
|
|
684
|
+
*
|
|
685
|
+
* Every connectable kind, its surfaces, and the predicates its routes can match on (engine-wide ones like `address_known` plus its own, like Discord's `guild_id`).
|
|
686
|
+
*
|
|
687
|
+
*/
|
|
688
|
+
static listChannelKinds(options) {
|
|
689
|
+
return (options?.client ?? client).get({
|
|
690
|
+
url: "/v1/channel-kinds",
|
|
691
|
+
...options
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* List a channel's routes
|
|
696
|
+
*/
|
|
697
|
+
static listChannelRoutes(options) {
|
|
698
|
+
return (options.client ?? client).get({
|
|
699
|
+
url: "/v1/projects/{project_id}/channels/{channel_id}/routes",
|
|
700
|
+
...options
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Create a route
|
|
705
|
+
*
|
|
706
|
+
* `action` is required; `agent_id` is required when it is `agent`, `text` when it is `message`; `repeat` is only valid alongside `action: message`. `surface`, when present, must be one this channel's kind serves (`GET /v1/channel-kinds`) — otherwise `400 unknown_surface`. `match` keys must be predicates that kind's registry declares — otherwise `400 unknown_predicate`. Writing a route for a surface whose transport mode is off (e.g. a Discord `guild_thread` route before `mention_threads` is enabled) still succeeds, with `unreachable_surface` in the response `warnings`.
|
|
707
|
+
*
|
|
708
|
+
*/
|
|
709
|
+
static createChannelRoute(options) {
|
|
710
|
+
return (options.client ?? client).post({
|
|
711
|
+
url: "/v1/projects/{project_id}/channels/{channel_id}/routes",
|
|
712
|
+
...options,
|
|
713
|
+
headers: {
|
|
714
|
+
"Content-Type": "application/json",
|
|
715
|
+
...options.headers
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* Delete a route
|
|
721
|
+
*/
|
|
722
|
+
static deleteChannelRoute(options) {
|
|
723
|
+
return (options.client ?? client).delete({
|
|
724
|
+
url: "/v1/projects/{project_id}/channels/{channel_id}/routes/{route_id}",
|
|
725
|
+
...options
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* Get a route
|
|
730
|
+
*/
|
|
731
|
+
static getChannelRoute(options) {
|
|
732
|
+
return (options.client ?? client).get({
|
|
733
|
+
url: "/v1/projects/{project_id}/channels/{channel_id}/routes/{route_id}",
|
|
734
|
+
...options
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Replace a route
|
|
739
|
+
*
|
|
740
|
+
* Full replace, the same validation as create.
|
|
741
|
+
*/
|
|
742
|
+
static updateChannelRoute(options) {
|
|
743
|
+
return (options.client ?? client).patch({
|
|
744
|
+
url: "/v1/projects/{project_id}/channels/{channel_id}/routes/{route_id}",
|
|
745
|
+
...options,
|
|
746
|
+
headers: {
|
|
747
|
+
"Content-Type": "application/json",
|
|
748
|
+
...options.headers
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Read the whole route table
|
|
754
|
+
*
|
|
755
|
+
* Every route across every channel in the project, one read — the table is small by construction (CHANNELS-ROUTING.md §3.6), so this is unpaginated.
|
|
756
|
+
*
|
|
757
|
+
*/
|
|
758
|
+
static listProjectChannelRoutes(options) {
|
|
759
|
+
return (options.client ?? client).get({
|
|
760
|
+
url: "/v1/projects/{project_id}/channel-routes",
|
|
761
|
+
...options
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Open a conversation
|
|
766
|
+
*
|
|
767
|
+
* The outbound-first path (CHANNELS-ROUTING.md §3.11): open a conversation for `{ channel_id, identifier }` ahead of any inbound message, which falls out of making the identifier the unit rather than the message. Resolves the same three-layer action an inbound would (§3.6); a `409` when that does not land on an agent — there is nothing to open for a `message`/`silence` outcome.
|
|
768
|
+
*
|
|
769
|
+
*/
|
|
770
|
+
static createConversation(options) {
|
|
771
|
+
return (options.client ?? client).post({
|
|
772
|
+
url: "/v1/projects/{project_id}/conversations",
|
|
773
|
+
...options,
|
|
774
|
+
headers: {
|
|
775
|
+
"Content-Type": "application/json",
|
|
776
|
+
...options.headers
|
|
777
|
+
}
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* List channels
|
|
782
|
+
*
|
|
783
|
+
* Lists the channels connected in the project.
|
|
784
|
+
*/
|
|
785
|
+
static listChannels(options) {
|
|
786
|
+
return (options.client ?? client).get({
|
|
787
|
+
url: "/v1/projects/{project_id}/channels",
|
|
788
|
+
...options
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Connect a channel
|
|
793
|
+
*
|
|
794
|
+
* Connect a channel. The required fields depend on `channel`; no credential is ever returned.
|
|
795
|
+
* **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). Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured.
|
|
796
|
+
* **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret:
|
|
797
|
+
* * **BYOT** (`credential_source: byot`, default) — supply
|
|
798
|
+
* `phone_number_id` and `access_token` from your own Meta app.
|
|
799
|
+
*
|
|
800
|
+
* * **Embedded signup** (`credential_source: embedded_signup`) — supply
|
|
801
|
+
* `code` and `waba_id` (and optionally `pin`) from the Meta popup;
|
|
802
|
+
* naturali exchanges the `code` for the token and subscribes its app to
|
|
803
|
+
* the WABA, so the customer never hands over a token. Returns `501` on
|
|
804
|
+
* deployments where Meta App credentials are not configured.
|
|
805
|
+
*
|
|
806
|
+
*/
|
|
807
|
+
static createChannel(options) {
|
|
808
|
+
return (options.client ?? client).post({
|
|
809
|
+
url: "/v1/projects/{project_id}/channels",
|
|
810
|
+
...options,
|
|
811
|
+
headers: {
|
|
812
|
+
"Content-Type": "application/json",
|
|
813
|
+
...options.headers
|
|
814
|
+
}
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Delete a channel
|
|
819
|
+
*
|
|
820
|
+
* Deletes the channel and whatever it provisioned — the WhatsApp send tool and write-only credential secret, or the Discord channel's sealed bot token (dropped with the row, closing its gateway connection).
|
|
821
|
+
*
|
|
822
|
+
*/
|
|
823
|
+
static deleteChannel(options) {
|
|
824
|
+
return (options.client ?? client).delete({
|
|
825
|
+
url: "/v1/projects/{project_id}/channels/{channel_id}",
|
|
826
|
+
...options
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Get a channel
|
|
831
|
+
*/
|
|
832
|
+
static getChannel(options) {
|
|
833
|
+
return (options.client ?? client).get({
|
|
834
|
+
url: "/v1/projects/{project_id}/channels/{channel_id}",
|
|
835
|
+
...options
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Update a channel
|
|
840
|
+
*
|
|
841
|
+
* Rotate the credential, update the kind's config (`waba_id` / `credential_source` for WhatsApp, `modes` for Discord), or flip the naturali-side status. At least one field is required. Rotating a WhatsApp token stores a new write-only secret, repoints the send tool and deletes the old secret; rotating a Discord bot token reseals it and the gateway worker reconnects with it.
|
|
842
|
+
*
|
|
843
|
+
*/
|
|
844
|
+
static updateChannel(options) {
|
|
845
|
+
return (options.client ?? client).patch({
|
|
846
|
+
url: "/v1/projects/{project_id}/channels/{channel_id}",
|
|
847
|
+
...options,
|
|
848
|
+
headers: {
|
|
849
|
+
"Content-Type": "application/json",
|
|
850
|
+
...options.headers
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* List the channel's conversations
|
|
856
|
+
*
|
|
857
|
+
* 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.
|
|
858
|
+
* Conversations are created by the inbound path (the WhatsApp webhook, the Discord gateway worker) when a real message arrives; there is no way to create one directly.
|
|
859
|
+
*
|
|
860
|
+
*/
|
|
861
|
+
static listChannelConversations(options) {
|
|
862
|
+
return (options.client ?? client).get({
|
|
863
|
+
url: "/v1/projects/{project_id}/channels/{channel_id}/conversations",
|
|
864
|
+
...options
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Get a conversation
|
|
869
|
+
*/
|
|
870
|
+
static getChannelConversation(options) {
|
|
871
|
+
return (options.client ?? client).get({
|
|
872
|
+
url: "/v1/projects/{project_id}/channels/{channel_id}/conversations/{conversation_id}",
|
|
873
|
+
...options
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* Read a conversation's transcript
|
|
878
|
+
*
|
|
879
|
+
* The conversation's messages, oldest first. naturali stores no message bodies — the dialogue lives in the runtime session the conversation maps to, so this reads through to the runtime. Pagination is `limit`/`offset` rather than an opaque cursor because the upstream is offset-based over a stable `position` ordering.
|
|
880
|
+
*
|
|
881
|
+
*/
|
|
882
|
+
static listChannelConversationMessages(options) {
|
|
883
|
+
return (options.client ?? client).get({
|
|
884
|
+
url: "/v1/projects/{project_id}/channels/{channel_id}/conversations/{conversation_id}/messages",
|
|
885
|
+
...options
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
};
|
|
623
889
|
var Agents = class {
|
|
624
890
|
/**
|
|
625
891
|
* List agents
|
|
@@ -968,37 +1234,28 @@ var Boards = class {
|
|
|
968
1234
|
});
|
|
969
1235
|
}
|
|
970
1236
|
};
|
|
971
|
-
var
|
|
1237
|
+
var Generations = class {
|
|
972
1238
|
/**
|
|
973
|
-
* List
|
|
1239
|
+
* List an agent's generations
|
|
1240
|
+
*
|
|
1241
|
+
* Lists the generation records the agent has produced, newest first. Filter by lifecycle `status` to find the failures without paging everything the agent has ever run.
|
|
974
1242
|
*
|
|
975
|
-
* Lists the channels connected in the project.
|
|
976
1243
|
*/
|
|
977
|
-
static
|
|
1244
|
+
static listAgentGenerations(options) {
|
|
978
1245
|
return (options.client ?? client).get({
|
|
979
|
-
url: "/v1/projects/{project_id}/
|
|
1246
|
+
url: "/v1/projects/{project_id}/agents/{agent_id}/generations",
|
|
980
1247
|
...options
|
|
981
1248
|
});
|
|
982
1249
|
}
|
|
983
1250
|
/**
|
|
984
|
-
*
|
|
985
|
-
*
|
|
986
|
-
* Connect a channel. The required fields depend on `channel`; no credential is ever returned.
|
|
987
|
-
* **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). Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured.
|
|
988
|
-
* **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret:
|
|
989
|
-
* * **BYOT** (`credential_source: byot`, default) — supply
|
|
990
|
-
* `phone_number_id` and `access_token` from your own Meta app.
|
|
1251
|
+
* Run an agent generation
|
|
991
1252
|
*
|
|
992
|
-
*
|
|
993
|
-
* `code` and `waba_id` (and optionally `pin`) from the Meta popup;
|
|
994
|
-
* naturali exchanges the `code` for the token and subscribes its app to
|
|
995
|
-
* the WABA, so the customer never hands over a token. Returns `501` on
|
|
996
|
-
* deployments where Meta App credentials are not configured.
|
|
1253
|
+
* Sends messages to the agent, resolves its tools, and runs the model loop. Returns the final text when `status` is `completed` (plus `object` when the agent has an output schema), or the pending `tool_calls` when `status` is `requires_action`. With `stream: true` the response is a Server-Sent Events stream (Content-Type text/event-stream) proxied from the runtime instead of a single JSON body.
|
|
997
1254
|
*
|
|
998
1255
|
*/
|
|
999
|
-
static
|
|
1256
|
+
static createGeneration(options) {
|
|
1000
1257
|
return (options.client ?? client).post({
|
|
1001
|
-
url: "/v1/projects/{project_id}/
|
|
1258
|
+
url: "/v1/projects/{project_id}/agents/{agent_id}/generations",
|
|
1002
1259
|
...options,
|
|
1003
1260
|
headers: {
|
|
1004
1261
|
"Content-Type": "application/json",
|
|
@@ -1007,145 +1264,10 @@ var Channels = class {
|
|
|
1007
1264
|
});
|
|
1008
1265
|
}
|
|
1009
1266
|
/**
|
|
1010
|
-
*
|
|
1267
|
+
* Get a generation
|
|
1011
1268
|
*
|
|
1012
|
-
*
|
|
1013
|
-
*
|
|
1014
|
-
*/
|
|
1015
|
-
static deleteChannel(options) {
|
|
1016
|
-
return (options.client ?? client).delete({
|
|
1017
|
-
url: "/v1/projects/{project_id}/channels/{channel_id}",
|
|
1018
|
-
...options
|
|
1019
|
-
});
|
|
1020
|
-
}
|
|
1021
|
-
/**
|
|
1022
|
-
* Get a channel
|
|
1023
|
-
*/
|
|
1024
|
-
static getChannel(options) {
|
|
1025
|
-
return (options.client ?? client).get({
|
|
1026
|
-
url: "/v1/projects/{project_id}/channels/{channel_id}",
|
|
1027
|
-
...options
|
|
1028
|
-
});
|
|
1029
|
-
}
|
|
1030
|
-
/**
|
|
1031
|
-
* Update a channel
|
|
1032
|
-
*
|
|
1033
|
-
* Rotate the credential, update the kind's config (`waba_id` / `credential_source` for WhatsApp, `modes` for Discord), or flip the naturali-side status. At least one field is required. Rotating a WhatsApp token stores a new write-only secret, repoints the send tool and deletes the old secret; rotating a Discord bot token reseals it and the gateway worker reconnects with it.
|
|
1034
|
-
*
|
|
1035
|
-
*/
|
|
1036
|
-
static updateChannel(options) {
|
|
1037
|
-
return (options.client ?? client).patch({
|
|
1038
|
-
url: "/v1/projects/{project_id}/channels/{channel_id}",
|
|
1039
|
-
...options,
|
|
1040
|
-
headers: {
|
|
1041
|
-
"Content-Type": "application/json",
|
|
1042
|
-
...options.headers
|
|
1043
|
-
}
|
|
1044
|
-
});
|
|
1045
|
-
}
|
|
1046
|
-
/**
|
|
1047
|
-
* Unbind the channel
|
|
1048
|
-
*/
|
|
1049
|
-
static deleteChannelBinding(options) {
|
|
1050
|
-
return (options.client ?? client).delete({
|
|
1051
|
-
url: "/v1/projects/{project_id}/channels/{channel_id}/binding",
|
|
1052
|
-
...options
|
|
1053
|
-
});
|
|
1054
|
-
}
|
|
1055
|
-
/**
|
|
1056
|
-
* Get the channel's binding
|
|
1057
|
-
*/
|
|
1058
|
-
static getChannelBinding(options) {
|
|
1059
|
-
return (options.client ?? client).get({
|
|
1060
|
-
url: "/v1/projects/{project_id}/channels/{channel_id}/binding",
|
|
1061
|
-
...options
|
|
1062
|
-
});
|
|
1063
|
-
}
|
|
1064
|
-
/**
|
|
1065
|
-
* Set the channel's binding
|
|
1066
|
-
*
|
|
1067
|
-
* Create or replace the channel's agent binding (a channel has one binding in v1). `agent_id` is required and must be an agent owned in the project; `language` / `config` / `status` default to null / null / active when absent (full replace).
|
|
1068
|
-
*
|
|
1069
|
-
*/
|
|
1070
|
-
static setChannelBinding(options) {
|
|
1071
|
-
return (options.client ?? client).put({
|
|
1072
|
-
url: "/v1/projects/{project_id}/channels/{channel_id}/binding",
|
|
1073
|
-
...options,
|
|
1074
|
-
headers: {
|
|
1075
|
-
"Content-Type": "application/json",
|
|
1076
|
-
...options.headers
|
|
1077
|
-
}
|
|
1078
|
-
});
|
|
1079
|
-
}
|
|
1080
|
-
/**
|
|
1081
|
-
* List the channel's conversations
|
|
1082
|
-
*
|
|
1083
|
-
* 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.
|
|
1084
|
-
* Conversations are created by the inbound path (the WhatsApp webhook, the Discord gateway worker) when a real message arrives; there is no way to create one directly.
|
|
1085
|
-
*
|
|
1086
|
-
*/
|
|
1087
|
-
static listChannelConversations(options) {
|
|
1088
|
-
return (options.client ?? client).get({
|
|
1089
|
-
url: "/v1/projects/{project_id}/channels/{channel_id}/conversations",
|
|
1090
|
-
...options
|
|
1091
|
-
});
|
|
1092
|
-
}
|
|
1093
|
-
/**
|
|
1094
|
-
* Get a conversation
|
|
1095
|
-
*/
|
|
1096
|
-
static getChannelConversation(options) {
|
|
1097
|
-
return (options.client ?? client).get({
|
|
1098
|
-
url: "/v1/projects/{project_id}/channels/{channel_id}/conversations/{conversation_id}",
|
|
1099
|
-
...options
|
|
1100
|
-
});
|
|
1101
|
-
}
|
|
1102
|
-
/**
|
|
1103
|
-
* Read a conversation's transcript
|
|
1104
|
-
*
|
|
1105
|
-
* The conversation's messages, oldest first. naturali stores no message bodies — the dialogue lives in the runtime session the conversation maps to, so this reads through to the runtime. Pagination is `limit`/`offset` rather than an opaque cursor because the upstream is offset-based over a stable `position` ordering.
|
|
1106
|
-
*
|
|
1107
|
-
*/
|
|
1108
|
-
static listChannelConversationMessages(options) {
|
|
1109
|
-
return (options.client ?? client).get({
|
|
1110
|
-
url: "/v1/projects/{project_id}/channels/{channel_id}/conversations/{conversation_id}/messages",
|
|
1111
|
-
...options
|
|
1112
|
-
});
|
|
1113
|
-
}
|
|
1114
|
-
};
|
|
1115
|
-
var Generations = class {
|
|
1116
|
-
/**
|
|
1117
|
-
* List an agent's generations
|
|
1118
|
-
*
|
|
1119
|
-
* Lists the generation records the agent has produced, newest first. Filter by lifecycle `status` to find the failures without paging everything the agent has ever run.
|
|
1120
|
-
*
|
|
1121
|
-
*/
|
|
1122
|
-
static listAgentGenerations(options) {
|
|
1123
|
-
return (options.client ?? client).get({
|
|
1124
|
-
url: "/v1/projects/{project_id}/agents/{agent_id}/generations",
|
|
1125
|
-
...options
|
|
1126
|
-
});
|
|
1127
|
-
}
|
|
1128
|
-
/**
|
|
1129
|
-
* Run an agent generation
|
|
1130
|
-
*
|
|
1131
|
-
* Sends messages to the agent, resolves its tools, and runs the model loop. Returns the final text when `status` is `completed` (plus `object` when the agent has an output schema), or the pending `tool_calls` when `status` is `requires_action`. With `stream: true` the response is a Server-Sent Events stream (Content-Type text/event-stream) proxied from the runtime instead of a single JSON body.
|
|
1132
|
-
*
|
|
1133
|
-
*/
|
|
1134
|
-
static createGeneration(options) {
|
|
1135
|
-
return (options.client ?? client).post({
|
|
1136
|
-
url: "/v1/projects/{project_id}/agents/{agent_id}/generations",
|
|
1137
|
-
...options,
|
|
1138
|
-
headers: {
|
|
1139
|
-
"Content-Type": "application/json",
|
|
1140
|
-
...options.headers
|
|
1141
|
-
}
|
|
1142
|
-
});
|
|
1143
|
-
}
|
|
1144
|
-
/**
|
|
1145
|
-
* Get a generation
|
|
1146
|
-
*
|
|
1147
|
-
* Returns one generation record. Flat rather than nested under the agent, because the ids that need resolving arrive on their own — a session reply carries a `generation_id` with no agent in hand.
|
|
1148
|
-
* A generation belonging to another project responds `404`, not `403` — the API never confirms that an id exists elsewhere.
|
|
1269
|
+
* Returns one generation record. Flat rather than nested under the agent, because the ids that need resolving arrive on their own — a session reply carries a `generation_id` with no agent in hand.
|
|
1270
|
+
* A generation belonging to another project responds `404`, not `403` — the API never confirms that an id exists elsewhere.
|
|
1149
1271
|
*
|
|
1150
1272
|
*/
|
|
1151
1273
|
static getGeneration(options) {
|
|
@@ -2458,11 +2580,11 @@ const dispatchCommand = async (args) => {
|
|
|
2458
2580
|
//#endregion
|
|
2459
2581
|
//#region src/generated/routes.ts
|
|
2460
2582
|
const routes = {
|
|
2461
|
-
"list-
|
|
2462
|
-
serviceClass: "
|
|
2463
|
-
operationId: "
|
|
2464
|
-
description: "
|
|
2465
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/
|
|
2583
|
+
"list-addresses": {
|
|
2584
|
+
serviceClass: "Channels",
|
|
2585
|
+
operationId: "listAddresses",
|
|
2586
|
+
description: "List addresses",
|
|
2587
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/addresses",
|
|
2466
2588
|
httpMethod: "get",
|
|
2467
2589
|
pathParams: ["project_id"],
|
|
2468
2590
|
queryParams: ["limit", "cursor"],
|
|
@@ -2490,13 +2612,35 @@ const routes = {
|
|
|
2490
2612
|
}
|
|
2491
2613
|
]
|
|
2492
2614
|
},
|
|
2493
|
-
"
|
|
2494
|
-
serviceClass: "
|
|
2495
|
-
operationId: "
|
|
2496
|
-
description: "
|
|
2497
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/
|
|
2498
|
-
httpMethod: "
|
|
2499
|
-
pathParams: ["project_id"],
|
|
2615
|
+
"get-address": {
|
|
2616
|
+
serviceClass: "Channels",
|
|
2617
|
+
operationId: "getAddress",
|
|
2618
|
+
description: "Get an address",
|
|
2619
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/addresses",
|
|
2620
|
+
httpMethod: "get",
|
|
2621
|
+
pathParams: ["project_id", "identifier"],
|
|
2622
|
+
queryParams: [],
|
|
2623
|
+
flags: [{
|
|
2624
|
+
"name": "project_id",
|
|
2625
|
+
"description": "Project public ID (proj_ prefix).",
|
|
2626
|
+
"required": true,
|
|
2627
|
+
"type": "string",
|
|
2628
|
+
"in": "path"
|
|
2629
|
+
}, {
|
|
2630
|
+
"name": "identifier",
|
|
2631
|
+
"description": "The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.\n",
|
|
2632
|
+
"required": true,
|
|
2633
|
+
"type": "string",
|
|
2634
|
+
"in": "path"
|
|
2635
|
+
}]
|
|
2636
|
+
},
|
|
2637
|
+
"set-address-action": {
|
|
2638
|
+
serviceClass: "Channels",
|
|
2639
|
+
operationId: "setAddressAction",
|
|
2640
|
+
description: "Upserts the address and its `action` in one call. `action: null` forgets the exception and defers back to the route table; any other `action` requires the same fields a route or channel default would (`agent_id` for `agent`, `text` for `message`).",
|
|
2641
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/addresses",
|
|
2642
|
+
httpMethod: "put",
|
|
2643
|
+
pathParams: ["project_id", "identifier"],
|
|
2500
2644
|
queryParams: [],
|
|
2501
2645
|
flags: [
|
|
2502
2646
|
{
|
|
@@ -2507,91 +2651,70 @@ const routes = {
|
|
|
2507
2651
|
"in": "path"
|
|
2508
2652
|
},
|
|
2509
2653
|
{
|
|
2510
|
-
"name": "
|
|
2511
|
-
"description": "
|
|
2654
|
+
"name": "identifier",
|
|
2655
|
+
"description": "The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.\n",
|
|
2512
2656
|
"required": true,
|
|
2513
2657
|
"type": "string",
|
|
2514
|
-
"in": "
|
|
2658
|
+
"in": "path"
|
|
2515
2659
|
},
|
|
2516
2660
|
{
|
|
2517
|
-
"name": "
|
|
2518
|
-
"description": "
|
|
2519
|
-
"required":
|
|
2661
|
+
"name": "action",
|
|
2662
|
+
"description": "",
|
|
2663
|
+
"required": true,
|
|
2520
2664
|
"type": "string",
|
|
2521
2665
|
"in": "body"
|
|
2522
2666
|
},
|
|
2523
2667
|
{
|
|
2524
|
-
"name": "
|
|
2525
|
-
"description": "
|
|
2668
|
+
"name": "agent_id",
|
|
2669
|
+
"description": "",
|
|
2526
2670
|
"required": false,
|
|
2527
2671
|
"type": "string",
|
|
2528
2672
|
"in": "body"
|
|
2529
2673
|
},
|
|
2530
2674
|
{
|
|
2531
|
-
"name": "
|
|
2532
|
-
"description": "
|
|
2675
|
+
"name": "text",
|
|
2676
|
+
"description": "",
|
|
2533
2677
|
"required": false,
|
|
2534
2678
|
"type": "string",
|
|
2535
2679
|
"in": "body"
|
|
2536
2680
|
},
|
|
2537
2681
|
{
|
|
2538
|
-
"name": "
|
|
2682
|
+
"name": "repeat",
|
|
2539
2683
|
"description": "",
|
|
2540
2684
|
"required": false,
|
|
2541
|
-
"type": "
|
|
2685
|
+
"type": "string",
|
|
2542
2686
|
"in": "body"
|
|
2543
2687
|
},
|
|
2544
2688
|
{
|
|
2545
|
-
"name": "
|
|
2689
|
+
"name": "language",
|
|
2546
2690
|
"description": "",
|
|
2547
2691
|
"required": false,
|
|
2548
|
-
"type": "
|
|
2692
|
+
"type": "string",
|
|
2549
2693
|
"in": "body"
|
|
2550
2694
|
},
|
|
2551
2695
|
{
|
|
2552
|
-
"name": "
|
|
2696
|
+
"name": "config",
|
|
2553
2697
|
"description": "",
|
|
2554
2698
|
"required": false,
|
|
2555
|
-
"type": "
|
|
2556
|
-
"in": "body"
|
|
2557
|
-
},
|
|
2558
|
-
{
|
|
2559
|
-
"name": "tool_ids",
|
|
2560
|
-
"description": "Tools to bind to the agent — each a tool_ id registered in this project. Replaces the whole binding set; [] clears it.\n",
|
|
2561
|
-
"required": false,
|
|
2562
|
-
"type": "array",
|
|
2699
|
+
"type": "object",
|
|
2563
2700
|
"in": "body"
|
|
2564
2701
|
},
|
|
2565
2702
|
{
|
|
2566
|
-
"name": "
|
|
2567
|
-
"description": "
|
|
2703
|
+
"name": "display_name",
|
|
2704
|
+
"description": "Set only when the address is created by this call.",
|
|
2568
2705
|
"required": false,
|
|
2569
2706
|
"type": "string",
|
|
2570
2707
|
"in": "body"
|
|
2571
|
-
},
|
|
2572
|
-
{
|
|
2573
|
-
"name": "step_rules",
|
|
2574
|
-
"description": "Per-step overrides of `tool_choice` (and, implicitly, which tools are active), applied on top of the agent's own `tool_choice` for the step number they name. The overall `tool_choice` otherwise governs every step of the run, with no relaxation once a tool has been called — the way to force a tool call on the first step without forcing one on every later step too (which runs the full `max_steps` before it can stop) is a rule for `step: 1` only. Null (the default) leaves it unset.\n",
|
|
2575
|
-
"required": false,
|
|
2576
|
-
"type": "array",
|
|
2577
|
-
"in": "body"
|
|
2578
|
-
},
|
|
2579
|
-
{
|
|
2580
|
-
"name": "output_schema",
|
|
2581
|
-
"description": "JSON Schema describing the structured object the model must return. When set, a non-streaming generation is constrained to it and the parsed value comes back as `object` on the generation result. Omit (the default) to leave the output unconstrained. Streaming generations are unaffected.\n",
|
|
2582
|
-
"required": false,
|
|
2583
|
-
"type": "object",
|
|
2584
|
-
"in": "body"
|
|
2585
2708
|
}
|
|
2586
2709
|
]
|
|
2587
2710
|
},
|
|
2588
|
-
"
|
|
2589
|
-
serviceClass: "
|
|
2590
|
-
operationId: "
|
|
2591
|
-
description: "
|
|
2592
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/
|
|
2593
|
-
httpMethod: "
|
|
2594
|
-
pathParams: ["project_id", "
|
|
2711
|
+
"delete-address": {
|
|
2712
|
+
serviceClass: "Channels",
|
|
2713
|
+
operationId: "deleteAddress",
|
|
2714
|
+
description: "Removes the address, its conversations, and its runtime actor and sessions.",
|
|
2715
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/addresses",
|
|
2716
|
+
httpMethod: "delete",
|
|
2717
|
+
pathParams: ["project_id", "identifier"],
|
|
2595
2718
|
queryParams: [],
|
|
2596
2719
|
flags: [{
|
|
2597
2720
|
"name": "project_id",
|
|
@@ -2600,21 +2723,21 @@ const routes = {
|
|
|
2600
2723
|
"type": "string",
|
|
2601
2724
|
"in": "path"
|
|
2602
2725
|
}, {
|
|
2603
|
-
"name": "
|
|
2604
|
-
"description": "
|
|
2726
|
+
"name": "identifier",
|
|
2727
|
+
"description": "The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.\n",
|
|
2605
2728
|
"required": true,
|
|
2606
2729
|
"type": "string",
|
|
2607
2730
|
"in": "path"
|
|
2608
2731
|
}]
|
|
2609
2732
|
},
|
|
2610
|
-
"
|
|
2611
|
-
serviceClass: "
|
|
2612
|
-
operationId: "
|
|
2613
|
-
description: "
|
|
2614
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/
|
|
2615
|
-
httpMethod: "
|
|
2616
|
-
pathParams: ["project_id", "
|
|
2617
|
-
queryParams: [],
|
|
2733
|
+
"list-address-conversations": {
|
|
2734
|
+
serviceClass: "Channels",
|
|
2735
|
+
operationId: "listAddressConversations",
|
|
2736
|
+
description: "Every conversation this address has had, across every channel it has ever messaged — an address is project-scoped, not channel-scoped.",
|
|
2737
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/addresses",
|
|
2738
|
+
httpMethod: "get",
|
|
2739
|
+
pathParams: ["project_id", "identifier"],
|
|
2740
|
+
queryParams: ["limit", "cursor"],
|
|
2618
2741
|
flags: [
|
|
2619
2742
|
{
|
|
2620
2743
|
"name": "project_id",
|
|
@@ -2624,26 +2747,214 @@ const routes = {
|
|
|
2624
2747
|
"in": "path"
|
|
2625
2748
|
},
|
|
2626
2749
|
{
|
|
2627
|
-
"name": "
|
|
2628
|
-
"description": "
|
|
2750
|
+
"name": "identifier",
|
|
2751
|
+
"description": "The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.\n",
|
|
2629
2752
|
"required": true,
|
|
2630
2753
|
"type": "string",
|
|
2631
2754
|
"in": "path"
|
|
2632
2755
|
},
|
|
2633
2756
|
{
|
|
2634
|
-
"name": "
|
|
2635
|
-
"description": "
|
|
2757
|
+
"name": "limit",
|
|
2758
|
+
"description": "Maximum items per page.",
|
|
2636
2759
|
"required": false,
|
|
2637
|
-
"type": "
|
|
2638
|
-
"in": "
|
|
2760
|
+
"type": "integer",
|
|
2761
|
+
"in": "query"
|
|
2639
2762
|
},
|
|
2640
2763
|
{
|
|
2641
|
-
"name": "
|
|
2642
|
-
"description": "",
|
|
2764
|
+
"name": "cursor",
|
|
2765
|
+
"description": "Opaque pagination cursor from a previous response's next_cursor.",
|
|
2643
2766
|
"required": false,
|
|
2644
2767
|
"type": "string",
|
|
2645
|
-
"in": "
|
|
2646
|
-
}
|
|
2768
|
+
"in": "query"
|
|
2769
|
+
}
|
|
2770
|
+
]
|
|
2771
|
+
},
|
|
2772
|
+
"list-agents": {
|
|
2773
|
+
serviceClass: "Agents",
|
|
2774
|
+
operationId: "listAgents",
|
|
2775
|
+
description: "Lists the agents in the project.",
|
|
2776
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/agents",
|
|
2777
|
+
httpMethod: "get",
|
|
2778
|
+
pathParams: ["project_id"],
|
|
2779
|
+
queryParams: ["limit", "cursor"],
|
|
2780
|
+
flags: [
|
|
2781
|
+
{
|
|
2782
|
+
"name": "project_id",
|
|
2783
|
+
"description": "Project public ID (proj_ prefix).",
|
|
2784
|
+
"required": true,
|
|
2785
|
+
"type": "string",
|
|
2786
|
+
"in": "path"
|
|
2787
|
+
},
|
|
2788
|
+
{
|
|
2789
|
+
"name": "limit",
|
|
2790
|
+
"description": "Maximum items per page.",
|
|
2791
|
+
"required": false,
|
|
2792
|
+
"type": "integer",
|
|
2793
|
+
"in": "query"
|
|
2794
|
+
},
|
|
2795
|
+
{
|
|
2796
|
+
"name": "cursor",
|
|
2797
|
+
"description": "Opaque pagination cursor from a previous response's next_cursor.",
|
|
2798
|
+
"required": false,
|
|
2799
|
+
"type": "string",
|
|
2800
|
+
"in": "query"
|
|
2801
|
+
}
|
|
2802
|
+
]
|
|
2803
|
+
},
|
|
2804
|
+
"create-agent": {
|
|
2805
|
+
serviceClass: "Agents",
|
|
2806
|
+
operationId: "createAgent",
|
|
2807
|
+
description: "Create an agent bound to one of the project's providers (provider_id), optionally attaching tools (tool_ids). See AgentCreate for the runtime config fields.",
|
|
2808
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/agents",
|
|
2809
|
+
httpMethod: "post",
|
|
2810
|
+
pathParams: ["project_id"],
|
|
2811
|
+
queryParams: [],
|
|
2812
|
+
flags: [
|
|
2813
|
+
{
|
|
2814
|
+
"name": "project_id",
|
|
2815
|
+
"description": "Project public ID (proj_ prefix).",
|
|
2816
|
+
"required": true,
|
|
2817
|
+
"type": "string",
|
|
2818
|
+
"in": "path"
|
|
2819
|
+
},
|
|
2820
|
+
{
|
|
2821
|
+
"name": "provider_id",
|
|
2822
|
+
"description": "A provider registered in this project (aip_ prefix).",
|
|
2823
|
+
"required": true,
|
|
2824
|
+
"type": "string",
|
|
2825
|
+
"in": "body"
|
|
2826
|
+
},
|
|
2827
|
+
{
|
|
2828
|
+
"name": "name",
|
|
2829
|
+
"description": "Human-readable label.",
|
|
2830
|
+
"required": false,
|
|
2831
|
+
"type": "string",
|
|
2832
|
+
"in": "body"
|
|
2833
|
+
},
|
|
2834
|
+
{
|
|
2835
|
+
"name": "model",
|
|
2836
|
+
"description": "Model string the runtime sends (see /v1/models provider_model). Defaults to the provider's default model.",
|
|
2837
|
+
"required": false,
|
|
2838
|
+
"type": "string",
|
|
2839
|
+
"in": "body"
|
|
2840
|
+
},
|
|
2841
|
+
{
|
|
2842
|
+
"name": "instructions",
|
|
2843
|
+
"description": "System instructions guiding the agent's behavior.",
|
|
2844
|
+
"required": false,
|
|
2845
|
+
"type": "string",
|
|
2846
|
+
"in": "body"
|
|
2847
|
+
},
|
|
2848
|
+
{
|
|
2849
|
+
"name": "temperature",
|
|
2850
|
+
"description": "",
|
|
2851
|
+
"required": false,
|
|
2852
|
+
"type": "number",
|
|
2853
|
+
"in": "body"
|
|
2854
|
+
},
|
|
2855
|
+
{
|
|
2856
|
+
"name": "max_steps",
|
|
2857
|
+
"description": "",
|
|
2858
|
+
"required": false,
|
|
2859
|
+
"type": "integer",
|
|
2860
|
+
"in": "body"
|
|
2861
|
+
},
|
|
2862
|
+
{
|
|
2863
|
+
"name": "max_context_messages",
|
|
2864
|
+
"description": "",
|
|
2865
|
+
"required": false,
|
|
2866
|
+
"type": "integer",
|
|
2867
|
+
"in": "body"
|
|
2868
|
+
},
|
|
2869
|
+
{
|
|
2870
|
+
"name": "tool_ids",
|
|
2871
|
+
"description": "Tools to bind to the agent — each a tool_ id registered in this project. Replaces the whole binding set; [] clears it.\n",
|
|
2872
|
+
"required": false,
|
|
2873
|
+
"type": "array",
|
|
2874
|
+
"in": "body"
|
|
2875
|
+
},
|
|
2876
|
+
{
|
|
2877
|
+
"name": "tool_choice",
|
|
2878
|
+
"description": "Tool choice strategy — a string (\"auto\" / \"required\") or an object ({ \"type\": \"tool\", \"name\": \"…\" }). Null (the default) leaves it unset.\n",
|
|
2879
|
+
"required": false,
|
|
2880
|
+
"type": "string",
|
|
2881
|
+
"in": "body"
|
|
2882
|
+
},
|
|
2883
|
+
{
|
|
2884
|
+
"name": "step_rules",
|
|
2885
|
+
"description": "Per-step overrides of `tool_choice` (and, implicitly, which tools are active), applied on top of the agent's own `tool_choice` for the step number they name. The overall `tool_choice` otherwise governs every step of the run, with no relaxation once a tool has been called — the way to force a tool call on the first step without forcing one on every later step too (which runs the full `max_steps` before it can stop) is a rule for `step: 1` only. Null (the default) leaves it unset.\n",
|
|
2886
|
+
"required": false,
|
|
2887
|
+
"type": "array",
|
|
2888
|
+
"in": "body"
|
|
2889
|
+
},
|
|
2890
|
+
{
|
|
2891
|
+
"name": "output_schema",
|
|
2892
|
+
"description": "JSON Schema describing the structured object the model must return. When set, a non-streaming generation is constrained to it and the parsed value comes back as `object` on the generation result. Omit (the default) to leave the output unconstrained. Streaming generations are unaffected.\n",
|
|
2893
|
+
"required": false,
|
|
2894
|
+
"type": "object",
|
|
2895
|
+
"in": "body"
|
|
2896
|
+
}
|
|
2897
|
+
]
|
|
2898
|
+
},
|
|
2899
|
+
"get-agent": {
|
|
2900
|
+
serviceClass: "Agents",
|
|
2901
|
+
operationId: "getAgent",
|
|
2902
|
+
description: "Get an agent",
|
|
2903
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/agents",
|
|
2904
|
+
httpMethod: "get",
|
|
2905
|
+
pathParams: ["project_id", "agent_id"],
|
|
2906
|
+
queryParams: [],
|
|
2907
|
+
flags: [{
|
|
2908
|
+
"name": "project_id",
|
|
2909
|
+
"description": "Project public ID (proj_ prefix).",
|
|
2910
|
+
"required": true,
|
|
2911
|
+
"type": "string",
|
|
2912
|
+
"in": "path"
|
|
2913
|
+
}, {
|
|
2914
|
+
"name": "agent_id",
|
|
2915
|
+
"description": "Agent public ID (agent_ prefix).",
|
|
2916
|
+
"required": true,
|
|
2917
|
+
"type": "string",
|
|
2918
|
+
"in": "path"
|
|
2919
|
+
}]
|
|
2920
|
+
},
|
|
2921
|
+
"update-agent": {
|
|
2922
|
+
serviceClass: "Agents",
|
|
2923
|
+
operationId: "updateAgent",
|
|
2924
|
+
description: "Change the bound provider, name, model, instructions, sampling/step config, attached tools (tool_ids/tool_choice/step_rules), the structured-output schema (output_schema), or the naturali-side status. At least one field is required.",
|
|
2925
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/agents",
|
|
2926
|
+
httpMethod: "patch",
|
|
2927
|
+
pathParams: ["project_id", "agent_id"],
|
|
2928
|
+
queryParams: [],
|
|
2929
|
+
flags: [
|
|
2930
|
+
{
|
|
2931
|
+
"name": "project_id",
|
|
2932
|
+
"description": "Project public ID (proj_ prefix).",
|
|
2933
|
+
"required": true,
|
|
2934
|
+
"type": "string",
|
|
2935
|
+
"in": "path"
|
|
2936
|
+
},
|
|
2937
|
+
{
|
|
2938
|
+
"name": "agent_id",
|
|
2939
|
+
"description": "Agent public ID (agent_ prefix).",
|
|
2940
|
+
"required": true,
|
|
2941
|
+
"type": "string",
|
|
2942
|
+
"in": "path"
|
|
2943
|
+
},
|
|
2944
|
+
{
|
|
2945
|
+
"name": "provider_id",
|
|
2946
|
+
"description": "Rebind the agent to a different provider in this project.",
|
|
2947
|
+
"required": false,
|
|
2948
|
+
"type": "string",
|
|
2949
|
+
"in": "body"
|
|
2950
|
+
},
|
|
2951
|
+
{
|
|
2952
|
+
"name": "name",
|
|
2953
|
+
"description": "",
|
|
2954
|
+
"required": false,
|
|
2955
|
+
"type": "string",
|
|
2956
|
+
"in": "body"
|
|
2957
|
+
},
|
|
2647
2958
|
{
|
|
2648
2959
|
"name": "model",
|
|
2649
2960
|
"description": "",
|
|
@@ -3227,13 +3538,23 @@ const routes = {
|
|
|
3227
3538
|
"in": "path"
|
|
3228
3539
|
}]
|
|
3229
3540
|
},
|
|
3230
|
-
"list-
|
|
3541
|
+
"list-channel-kinds": {
|
|
3231
3542
|
serviceClass: "Channels",
|
|
3232
|
-
operationId: "
|
|
3233
|
-
description: "
|
|
3234
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/
|
|
3543
|
+
operationId: "listChannelKinds",
|
|
3544
|
+
description: "Every connectable kind, its surfaces, and the predicates its routes can match on (engine-wide ones like `address_known` plus its own, like Discord's `guild_id`).",
|
|
3545
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channel-kinds",
|
|
3235
3546
|
httpMethod: "get",
|
|
3236
|
-
pathParams: [
|
|
3547
|
+
pathParams: [],
|
|
3548
|
+
queryParams: [],
|
|
3549
|
+
flags: []
|
|
3550
|
+
},
|
|
3551
|
+
"list-channel-routes": {
|
|
3552
|
+
serviceClass: "Channels",
|
|
3553
|
+
operationId: "listChannelRoutes",
|
|
3554
|
+
description: "List a channel's routes",
|
|
3555
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channel-routes",
|
|
3556
|
+
httpMethod: "get",
|
|
3557
|
+
pathParams: ["project_id", "channel_id"],
|
|
3237
3558
|
queryParams: ["limit", "cursor"],
|
|
3238
3559
|
flags: [
|
|
3239
3560
|
{
|
|
@@ -3243,6 +3564,13 @@ const routes = {
|
|
|
3243
3564
|
"type": "string",
|
|
3244
3565
|
"in": "path"
|
|
3245
3566
|
},
|
|
3567
|
+
{
|
|
3568
|
+
"name": "channel_id",
|
|
3569
|
+
"description": "Channel public ID (chan_ prefix).",
|
|
3570
|
+
"required": true,
|
|
3571
|
+
"type": "string",
|
|
3572
|
+
"in": "path"
|
|
3573
|
+
},
|
|
3246
3574
|
{
|
|
3247
3575
|
"name": "limit",
|
|
3248
3576
|
"description": "Maximum items per page.",
|
|
@@ -3259,13 +3587,13 @@ const routes = {
|
|
|
3259
3587
|
}
|
|
3260
3588
|
]
|
|
3261
3589
|
},
|
|
3262
|
-
"create-channel": {
|
|
3590
|
+
"create-channel-route": {
|
|
3263
3591
|
serviceClass: "Channels",
|
|
3264
|
-
operationId: "
|
|
3265
|
-
description: "
|
|
3266
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/
|
|
3592
|
+
operationId: "createChannelRoute",
|
|
3593
|
+
description: "`action` is required; `agent_id` is required when it is `agent`, `text` when it is `message`; `repeat` is only valid alongside `action: message`. `surface`, when present, must be one this channel's kind serves (`GET /v1/channel-kinds`) — otherwise `400 unknown_surface`. `match` keys must be predicates that kind's registry declares — otherwise `400 unknown_predicate`. Writing a route for a surface whose transport mode is off (e.g. a Discord `guild_thread` route before `mention_threads` is enabled) still succeeds, with `unreachable_surface` in the response `warnings`.",
|
|
3594
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channel-routes",
|
|
3267
3595
|
httpMethod: "post",
|
|
3268
|
-
pathParams: ["project_id"],
|
|
3596
|
+
pathParams: ["project_id", "channel_id"],
|
|
3269
3597
|
queryParams: [],
|
|
3270
3598
|
flags: [
|
|
3271
3599
|
{
|
|
@@ -3276,106 +3604,131 @@ const routes = {
|
|
|
3276
3604
|
"in": "path"
|
|
3277
3605
|
},
|
|
3278
3606
|
{
|
|
3279
|
-
"name": "
|
|
3607
|
+
"name": "channel_id",
|
|
3608
|
+
"description": "Channel public ID (chan_ prefix).",
|
|
3609
|
+
"required": true,
|
|
3610
|
+
"type": "string",
|
|
3611
|
+
"in": "path"
|
|
3612
|
+
},
|
|
3613
|
+
{
|
|
3614
|
+
"name": "surface",
|
|
3280
3615
|
"description": "",
|
|
3281
3616
|
"required": false,
|
|
3282
3617
|
"type": "string",
|
|
3283
3618
|
"in": "body"
|
|
3284
3619
|
},
|
|
3285
3620
|
{
|
|
3286
|
-
"name": "
|
|
3287
|
-
"description": "
|
|
3621
|
+
"name": "match",
|
|
3622
|
+
"description": "",
|
|
3288
3623
|
"required": false,
|
|
3289
|
-
"type": "
|
|
3624
|
+
"type": "object",
|
|
3290
3625
|
"in": "body"
|
|
3291
3626
|
},
|
|
3292
3627
|
{
|
|
3293
|
-
"name": "
|
|
3628
|
+
"name": "priority",
|
|
3294
3629
|
"description": "",
|
|
3295
3630
|
"required": false,
|
|
3296
|
-
"type": "
|
|
3631
|
+
"type": "integer",
|
|
3297
3632
|
"in": "body"
|
|
3298
3633
|
},
|
|
3299
3634
|
{
|
|
3300
|
-
"name": "
|
|
3301
|
-
"description": "
|
|
3302
|
-
"required":
|
|
3635
|
+
"name": "action",
|
|
3636
|
+
"description": "",
|
|
3637
|
+
"required": true,
|
|
3303
3638
|
"type": "string",
|
|
3304
3639
|
"in": "body"
|
|
3305
3640
|
},
|
|
3306
3641
|
{
|
|
3307
|
-
"name": "
|
|
3308
|
-
"description": "
|
|
3642
|
+
"name": "agent_id",
|
|
3643
|
+
"description": "",
|
|
3309
3644
|
"required": false,
|
|
3310
3645
|
"type": "string",
|
|
3311
3646
|
"in": "body"
|
|
3312
3647
|
},
|
|
3313
3648
|
{
|
|
3314
|
-
"name": "
|
|
3315
|
-
"description": "
|
|
3649
|
+
"name": "text",
|
|
3650
|
+
"description": "",
|
|
3316
3651
|
"required": false,
|
|
3317
3652
|
"type": "string",
|
|
3318
3653
|
"in": "body"
|
|
3319
3654
|
},
|
|
3320
3655
|
{
|
|
3321
|
-
"name": "
|
|
3322
|
-
"description": "
|
|
3656
|
+
"name": "repeat",
|
|
3657
|
+
"description": "",
|
|
3323
3658
|
"required": false,
|
|
3324
3659
|
"type": "string",
|
|
3325
3660
|
"in": "body"
|
|
3326
3661
|
},
|
|
3327
3662
|
{
|
|
3328
|
-
"name": "
|
|
3329
|
-
"description": "
|
|
3663
|
+
"name": "language",
|
|
3664
|
+
"description": "",
|
|
3330
3665
|
"required": false,
|
|
3331
3666
|
"type": "string",
|
|
3332
3667
|
"in": "body"
|
|
3333
3668
|
},
|
|
3334
3669
|
{
|
|
3335
|
-
"name": "
|
|
3336
|
-
"description": "
|
|
3670
|
+
"name": "config",
|
|
3671
|
+
"description": "",
|
|
3337
3672
|
"required": false,
|
|
3338
|
-
"type": "
|
|
3673
|
+
"type": "object",
|
|
3339
3674
|
"in": "body"
|
|
3340
3675
|
},
|
|
3341
3676
|
{
|
|
3342
|
-
"name": "
|
|
3343
|
-
"description": "
|
|
3677
|
+
"name": "status",
|
|
3678
|
+
"description": "",
|
|
3344
3679
|
"required": false,
|
|
3345
|
-
"type": "
|
|
3680
|
+
"type": "string",
|
|
3346
3681
|
"in": "body"
|
|
3347
3682
|
}
|
|
3348
3683
|
]
|
|
3349
3684
|
},
|
|
3350
|
-
"get-channel": {
|
|
3685
|
+
"get-channel-route": {
|
|
3351
3686
|
serviceClass: "Channels",
|
|
3352
|
-
operationId: "
|
|
3353
|
-
description: "Get a
|
|
3354
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/
|
|
3687
|
+
operationId: "getChannelRoute",
|
|
3688
|
+
description: "Get a route",
|
|
3689
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channel-routes",
|
|
3355
3690
|
httpMethod: "get",
|
|
3356
|
-
pathParams: [
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
"
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3691
|
+
pathParams: [
|
|
3692
|
+
"project_id",
|
|
3693
|
+
"channel_id",
|
|
3694
|
+
"route_id"
|
|
3695
|
+
],
|
|
3696
|
+
queryParams: [],
|
|
3697
|
+
flags: [
|
|
3698
|
+
{
|
|
3699
|
+
"name": "project_id",
|
|
3700
|
+
"description": "Project public ID (proj_ prefix).",
|
|
3701
|
+
"required": true,
|
|
3702
|
+
"type": "string",
|
|
3703
|
+
"in": "path"
|
|
3704
|
+
},
|
|
3705
|
+
{
|
|
3706
|
+
"name": "channel_id",
|
|
3707
|
+
"description": "Channel public ID (chan_ prefix).",
|
|
3708
|
+
"required": true,
|
|
3709
|
+
"type": "string",
|
|
3710
|
+
"in": "path"
|
|
3711
|
+
},
|
|
3712
|
+
{
|
|
3713
|
+
"name": "route_id",
|
|
3714
|
+
"description": "Route public ID (route_ prefix).",
|
|
3715
|
+
"required": true,
|
|
3716
|
+
"type": "string",
|
|
3717
|
+
"in": "path"
|
|
3718
|
+
}
|
|
3719
|
+
]
|
|
3371
3720
|
},
|
|
3372
|
-
"update-channel": {
|
|
3721
|
+
"update-channel-route": {
|
|
3373
3722
|
serviceClass: "Channels",
|
|
3374
|
-
operationId: "
|
|
3375
|
-
description: "
|
|
3376
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/
|
|
3723
|
+
operationId: "updateChannelRoute",
|
|
3724
|
+
description: "Full replace, the same validation as create.",
|
|
3725
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channel-routes",
|
|
3377
3726
|
httpMethod: "patch",
|
|
3378
|
-
pathParams: [
|
|
3727
|
+
pathParams: [
|
|
3728
|
+
"project_id",
|
|
3729
|
+
"channel_id",
|
|
3730
|
+
"route_id"
|
|
3731
|
+
],
|
|
3379
3732
|
queryParams: [],
|
|
3380
3733
|
flags: [
|
|
3381
3734
|
{
|
|
@@ -3393,36 +3746,71 @@ const routes = {
|
|
|
3393
3746
|
"in": "path"
|
|
3394
3747
|
},
|
|
3395
3748
|
{
|
|
3396
|
-
"name": "
|
|
3397
|
-
"description": "
|
|
3749
|
+
"name": "route_id",
|
|
3750
|
+
"description": "Route public ID (route_ prefix).",
|
|
3751
|
+
"required": true,
|
|
3752
|
+
"type": "string",
|
|
3753
|
+
"in": "path"
|
|
3754
|
+
},
|
|
3755
|
+
{
|
|
3756
|
+
"name": "surface",
|
|
3757
|
+
"description": "",
|
|
3398
3758
|
"required": false,
|
|
3399
3759
|
"type": "string",
|
|
3400
3760
|
"in": "body"
|
|
3401
3761
|
},
|
|
3402
3762
|
{
|
|
3403
|
-
"name": "
|
|
3763
|
+
"name": "match",
|
|
3764
|
+
"description": "",
|
|
3765
|
+
"required": false,
|
|
3766
|
+
"type": "object",
|
|
3767
|
+
"in": "body"
|
|
3768
|
+
},
|
|
3769
|
+
{
|
|
3770
|
+
"name": "priority",
|
|
3404
3771
|
"description": "",
|
|
3405
3772
|
"required": false,
|
|
3773
|
+
"type": "integer",
|
|
3774
|
+
"in": "body"
|
|
3775
|
+
},
|
|
3776
|
+
{
|
|
3777
|
+
"name": "action",
|
|
3778
|
+
"description": "",
|
|
3779
|
+
"required": true,
|
|
3406
3780
|
"type": "string",
|
|
3407
3781
|
"in": "body"
|
|
3408
3782
|
},
|
|
3409
3783
|
{
|
|
3410
|
-
"name": "
|
|
3784
|
+
"name": "agent_id",
|
|
3411
3785
|
"description": "",
|
|
3412
3786
|
"required": false,
|
|
3413
3787
|
"type": "string",
|
|
3414
3788
|
"in": "body"
|
|
3415
3789
|
},
|
|
3416
3790
|
{
|
|
3417
|
-
"name": "
|
|
3418
|
-
"description": "
|
|
3791
|
+
"name": "text",
|
|
3792
|
+
"description": "",
|
|
3419
3793
|
"required": false,
|
|
3420
3794
|
"type": "string",
|
|
3421
3795
|
"in": "body"
|
|
3422
3796
|
},
|
|
3423
3797
|
{
|
|
3424
|
-
"name": "
|
|
3425
|
-
"description": "
|
|
3798
|
+
"name": "repeat",
|
|
3799
|
+
"description": "",
|
|
3800
|
+
"required": false,
|
|
3801
|
+
"type": "string",
|
|
3802
|
+
"in": "body"
|
|
3803
|
+
},
|
|
3804
|
+
{
|
|
3805
|
+
"name": "language",
|
|
3806
|
+
"description": "",
|
|
3807
|
+
"required": false,
|
|
3808
|
+
"type": "string",
|
|
3809
|
+
"in": "body"
|
|
3810
|
+
},
|
|
3811
|
+
{
|
|
3812
|
+
"name": "config",
|
|
3813
|
+
"description": "",
|
|
3426
3814
|
"required": false,
|
|
3427
3815
|
"type": "object",
|
|
3428
3816
|
"in": "body"
|
|
@@ -3436,13 +3824,49 @@ const routes = {
|
|
|
3436
3824
|
}
|
|
3437
3825
|
]
|
|
3438
3826
|
},
|
|
3439
|
-
"delete-channel": {
|
|
3827
|
+
"delete-channel-route": {
|
|
3440
3828
|
serviceClass: "Channels",
|
|
3441
|
-
operationId: "
|
|
3442
|
-
description: "
|
|
3443
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/
|
|
3829
|
+
operationId: "deleteChannelRoute",
|
|
3830
|
+
description: "Delete a route",
|
|
3831
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channel-routes",
|
|
3444
3832
|
httpMethod: "delete",
|
|
3445
|
-
pathParams: [
|
|
3833
|
+
pathParams: [
|
|
3834
|
+
"project_id",
|
|
3835
|
+
"channel_id",
|
|
3836
|
+
"route_id"
|
|
3837
|
+
],
|
|
3838
|
+
queryParams: [],
|
|
3839
|
+
flags: [
|
|
3840
|
+
{
|
|
3841
|
+
"name": "project_id",
|
|
3842
|
+
"description": "Project public ID (proj_ prefix).",
|
|
3843
|
+
"required": true,
|
|
3844
|
+
"type": "string",
|
|
3845
|
+
"in": "path"
|
|
3846
|
+
},
|
|
3847
|
+
{
|
|
3848
|
+
"name": "channel_id",
|
|
3849
|
+
"description": "Channel public ID (chan_ prefix).",
|
|
3850
|
+
"required": true,
|
|
3851
|
+
"type": "string",
|
|
3852
|
+
"in": "path"
|
|
3853
|
+
},
|
|
3854
|
+
{
|
|
3855
|
+
"name": "route_id",
|
|
3856
|
+
"description": "Route public ID (route_ prefix).",
|
|
3857
|
+
"required": true,
|
|
3858
|
+
"type": "string",
|
|
3859
|
+
"in": "path"
|
|
3860
|
+
}
|
|
3861
|
+
]
|
|
3862
|
+
},
|
|
3863
|
+
"list-project-channel-routes": {
|
|
3864
|
+
serviceClass: "Channels",
|
|
3865
|
+
operationId: "listProjectChannelRoutes",
|
|
3866
|
+
description: "Every route across every channel in the project, one read — the table is small by construction (CHANNELS-ROUTING.md §3.6), so this is unpaginated.",
|
|
3867
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channel-routes",
|
|
3868
|
+
httpMethod: "get",
|
|
3869
|
+
pathParams: ["project_id"],
|
|
3446
3870
|
queryParams: [],
|
|
3447
3871
|
flags: [{
|
|
3448
3872
|
"name": "project_id",
|
|
@@ -3450,18 +3874,171 @@ const routes = {
|
|
|
3450
3874
|
"required": true,
|
|
3451
3875
|
"type": "string",
|
|
3452
3876
|
"in": "path"
|
|
3453
|
-
}, {
|
|
3454
|
-
"name": "channel_id",
|
|
3455
|
-
"description": "Channel public ID (chan_ prefix).",
|
|
3456
|
-
"required": true,
|
|
3457
|
-
"type": "string",
|
|
3458
|
-
"in": "path"
|
|
3459
3877
|
}]
|
|
3460
3878
|
},
|
|
3461
|
-
"
|
|
3879
|
+
"create-conversation": {
|
|
3880
|
+
serviceClass: "Channels",
|
|
3881
|
+
operationId: "createConversation",
|
|
3882
|
+
description: "The outbound-first path (CHANNELS-ROUTING.md §3.11): open a conversation for `{ channel_id, identifier }` ahead of any inbound message, which falls out of making the identifier the unit rather than the message. Resolves the same three-layer action an inbound would (§3.6); a `409` when that does not land on an agent — there is nothing to open for a `message`/`silence` outcome.",
|
|
3883
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channels",
|
|
3884
|
+
httpMethod: "post",
|
|
3885
|
+
pathParams: ["project_id"],
|
|
3886
|
+
queryParams: [],
|
|
3887
|
+
flags: [
|
|
3888
|
+
{
|
|
3889
|
+
"name": "project_id",
|
|
3890
|
+
"description": "Project public ID (proj_ prefix).",
|
|
3891
|
+
"required": true,
|
|
3892
|
+
"type": "string",
|
|
3893
|
+
"in": "path"
|
|
3894
|
+
},
|
|
3895
|
+
{
|
|
3896
|
+
"name": "channel_id",
|
|
3897
|
+
"description": "",
|
|
3898
|
+
"required": true,
|
|
3899
|
+
"type": "string",
|
|
3900
|
+
"in": "body"
|
|
3901
|
+
},
|
|
3902
|
+
{
|
|
3903
|
+
"name": "identifier",
|
|
3904
|
+
"description": "The bare, channel-native identifier (a phone number, a Discord user id).",
|
|
3905
|
+
"required": true,
|
|
3906
|
+
"type": "string",
|
|
3907
|
+
"in": "body"
|
|
3908
|
+
}
|
|
3909
|
+
]
|
|
3910
|
+
},
|
|
3911
|
+
"list-channels": {
|
|
3462
3912
|
serviceClass: "Channels",
|
|
3463
|
-
operationId: "
|
|
3464
|
-
description: "
|
|
3913
|
+
operationId: "listChannels",
|
|
3914
|
+
description: "Lists the channels connected in the project.",
|
|
3915
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channels",
|
|
3916
|
+
httpMethod: "get",
|
|
3917
|
+
pathParams: ["project_id"],
|
|
3918
|
+
queryParams: ["limit", "cursor"],
|
|
3919
|
+
flags: [
|
|
3920
|
+
{
|
|
3921
|
+
"name": "project_id",
|
|
3922
|
+
"description": "Project public ID (proj_ prefix).",
|
|
3923
|
+
"required": true,
|
|
3924
|
+
"type": "string",
|
|
3925
|
+
"in": "path"
|
|
3926
|
+
},
|
|
3927
|
+
{
|
|
3928
|
+
"name": "limit",
|
|
3929
|
+
"description": "Maximum items per page.",
|
|
3930
|
+
"required": false,
|
|
3931
|
+
"type": "integer",
|
|
3932
|
+
"in": "query"
|
|
3933
|
+
},
|
|
3934
|
+
{
|
|
3935
|
+
"name": "cursor",
|
|
3936
|
+
"description": "Opaque pagination cursor from a previous response's next_cursor.",
|
|
3937
|
+
"required": false,
|
|
3938
|
+
"type": "string",
|
|
3939
|
+
"in": "query"
|
|
3940
|
+
}
|
|
3941
|
+
]
|
|
3942
|
+
},
|
|
3943
|
+
"create-channel": {
|
|
3944
|
+
serviceClass: "Channels",
|
|
3945
|
+
operationId: "createChannel",
|
|
3946
|
+
description: "Connect a channel. The required fields depend on `channel`; no credential is ever returned. **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). Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured. **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret: * **BYOT** (`credential_source: byot`, default) — supply `phone_number_id` and `access_token` from your own Meta app. * **Embedded signup** (`credential_source: embedded_signup`) — supply `code` and `waba_id` (and optionally `pin`) from the Meta popup; naturali exchanges the `code` for the token and subscribes its app to the WABA, so the customer never hands over a token. Returns `501` on deployments where Meta App credentials are not configured.",
|
|
3947
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channels",
|
|
3948
|
+
httpMethod: "post",
|
|
3949
|
+
pathParams: ["project_id"],
|
|
3950
|
+
queryParams: [],
|
|
3951
|
+
flags: [
|
|
3952
|
+
{
|
|
3953
|
+
"name": "project_id",
|
|
3954
|
+
"description": "Project public ID (proj_ prefix).",
|
|
3955
|
+
"required": true,
|
|
3956
|
+
"type": "string",
|
|
3957
|
+
"in": "path"
|
|
3958
|
+
},
|
|
3959
|
+
{
|
|
3960
|
+
"name": "default",
|
|
3961
|
+
"description": "`action` is required; `agent_id` is required when it is `agent`, `text` when it is `message`. `repeat` is only valid alongside `action: message`.\n",
|
|
3962
|
+
"required": true,
|
|
3963
|
+
"type": "object",
|
|
3964
|
+
"in": "body"
|
|
3965
|
+
},
|
|
3966
|
+
{
|
|
3967
|
+
"name": "channel",
|
|
3968
|
+
"description": "",
|
|
3969
|
+
"required": false,
|
|
3970
|
+
"type": "string",
|
|
3971
|
+
"in": "body"
|
|
3972
|
+
},
|
|
3973
|
+
{
|
|
3974
|
+
"name": "phone_number_id",
|
|
3975
|
+
"description": "Required for `whatsapp`.",
|
|
3976
|
+
"required": false,
|
|
3977
|
+
"type": "string",
|
|
3978
|
+
"in": "body"
|
|
3979
|
+
},
|
|
3980
|
+
{
|
|
3981
|
+
"name": "credential_source",
|
|
3982
|
+
"description": "",
|
|
3983
|
+
"required": false,
|
|
3984
|
+
"type": "string",
|
|
3985
|
+
"in": "body"
|
|
3986
|
+
},
|
|
3987
|
+
{
|
|
3988
|
+
"name": "access_token",
|
|
3989
|
+
"description": "Write-only. Required for `byot`. The WhatsApp access token from your own Meta app. Accepted on write, never returned.\n",
|
|
3990
|
+
"required": false,
|
|
3991
|
+
"type": "string",
|
|
3992
|
+
"in": "body"
|
|
3993
|
+
},
|
|
3994
|
+
{
|
|
3995
|
+
"name": "code",
|
|
3996
|
+
"description": "Required for `embedded_signup`. The short-lived authorization code from the Meta popup; naturali exchanges it for the access token server-side. Never stored or returned.\n",
|
|
3997
|
+
"required": false,
|
|
3998
|
+
"type": "string",
|
|
3999
|
+
"in": "body"
|
|
4000
|
+
},
|
|
4001
|
+
{
|
|
4002
|
+
"name": "pin",
|
|
4003
|
+
"description": "Optional (`embedded_signup` only). The number's two-step-verification PIN; when present, naturali registers the number for Cloud API sending. Never stored or returned.\n",
|
|
4004
|
+
"required": false,
|
|
4005
|
+
"type": "string",
|
|
4006
|
+
"in": "body"
|
|
4007
|
+
},
|
|
4008
|
+
{
|
|
4009
|
+
"name": "waba_id",
|
|
4010
|
+
"description": "Required for `embedded_signup`; optional for `byot`.",
|
|
4011
|
+
"required": false,
|
|
4012
|
+
"type": "string",
|
|
4013
|
+
"in": "body"
|
|
4014
|
+
},
|
|
4015
|
+
{
|
|
4016
|
+
"name": "application_id",
|
|
4017
|
+
"description": "Required for `discord`. The Discord application id.",
|
|
4018
|
+
"required": false,
|
|
4019
|
+
"type": "string",
|
|
4020
|
+
"in": "body"
|
|
4021
|
+
},
|
|
4022
|
+
{
|
|
4023
|
+
"name": "bot_token",
|
|
4024
|
+
"description": "Write-only. Required for `discord`. The bot token, sealed in naturali's encrypted store so the gateway worker can authenticate its WebSocket. Accepted on write, never returned.\n",
|
|
4025
|
+
"required": false,
|
|
4026
|
+
"type": "string",
|
|
4027
|
+
"in": "body"
|
|
4028
|
+
},
|
|
4029
|
+
{
|
|
4030
|
+
"name": "modes",
|
|
4031
|
+
"description": "Which Discord Gateway flows this channel serves; null for non-Discord channels. At least one must be enabled.\n* `dms` — the bot converses 1:1 in direct messages (the WhatsApp shape).\n Needs only the non-privileged `DIRECT_MESSAGES` intent.\n\n* `mention_threads` — an @mention in a server opens a thread, and the\n whole thread is one conversation. Reading the follow-up messages in\n the thread needs the **privileged** `MESSAGE_CONTENT` intent, which\n you enable on your own Discord app (Discord requires bot verification\n past ~100 servers), so it is off unless you ask for it.\n",
|
|
4032
|
+
"required": false,
|
|
4033
|
+
"type": "object",
|
|
4034
|
+
"in": "body"
|
|
4035
|
+
}
|
|
4036
|
+
]
|
|
4037
|
+
},
|
|
4038
|
+
"get-channel": {
|
|
4039
|
+
serviceClass: "Channels",
|
|
4040
|
+
operationId: "getChannel",
|
|
4041
|
+
description: "Get a channel",
|
|
3465
4042
|
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channels",
|
|
3466
4043
|
httpMethod: "get",
|
|
3467
4044
|
pathParams: ["project_id", "channel_id"],
|
|
@@ -3480,12 +4057,12 @@ const routes = {
|
|
|
3480
4057
|
"in": "path"
|
|
3481
4058
|
}]
|
|
3482
4059
|
},
|
|
3483
|
-
"
|
|
4060
|
+
"update-channel": {
|
|
3484
4061
|
serviceClass: "Channels",
|
|
3485
|
-
operationId: "
|
|
3486
|
-
description: "
|
|
4062
|
+
operationId: "updateChannel",
|
|
4063
|
+
description: "Rotate the credential, update the kind's config (`waba_id` / `credential_source` for WhatsApp, `modes` for Discord), or flip the naturali-side status. At least one field is required. Rotating a WhatsApp token stores a new write-only secret, repoints the send tool and deletes the old secret; rotating a Discord bot token reseals it and the gateway worker reconnects with it.",
|
|
3487
4064
|
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channels",
|
|
3488
|
-
httpMethod: "
|
|
4065
|
+
httpMethod: "patch",
|
|
3489
4066
|
pathParams: ["project_id", "channel_id"],
|
|
3490
4067
|
queryParams: [],
|
|
3491
4068
|
flags: [
|
|
@@ -3504,22 +4081,43 @@ const routes = {
|
|
|
3504
4081
|
"in": "path"
|
|
3505
4082
|
},
|
|
3506
4083
|
{
|
|
3507
|
-
"name": "
|
|
4084
|
+
"name": "default",
|
|
4085
|
+
"description": "`action` is required; `agent_id` is required when it is `agent`, `text` when it is `message`. `repeat` is only valid alongside `action: message`.\n",
|
|
4086
|
+
"required": false,
|
|
4087
|
+
"type": "object",
|
|
4088
|
+
"in": "body"
|
|
4089
|
+
},
|
|
4090
|
+
{
|
|
4091
|
+
"name": "access_token",
|
|
4092
|
+
"description": "WhatsApp. Write-only. Replaces the stored credential.",
|
|
4093
|
+
"required": false,
|
|
4094
|
+
"type": "string",
|
|
4095
|
+
"in": "body"
|
|
4096
|
+
},
|
|
4097
|
+
{
|
|
4098
|
+
"name": "waba_id",
|
|
3508
4099
|
"description": "",
|
|
3509
|
-
"required":
|
|
4100
|
+
"required": false,
|
|
3510
4101
|
"type": "string",
|
|
3511
4102
|
"in": "body"
|
|
3512
4103
|
},
|
|
3513
4104
|
{
|
|
3514
|
-
"name": "
|
|
4105
|
+
"name": "credential_source",
|
|
3515
4106
|
"description": "",
|
|
3516
4107
|
"required": false,
|
|
3517
4108
|
"type": "string",
|
|
3518
4109
|
"in": "body"
|
|
3519
4110
|
},
|
|
3520
4111
|
{
|
|
3521
|
-
"name": "
|
|
3522
|
-
"description": "
|
|
4112
|
+
"name": "bot_token",
|
|
4113
|
+
"description": "Discord. Write-only. Rotates the sealed bot token.",
|
|
4114
|
+
"required": false,
|
|
4115
|
+
"type": "string",
|
|
4116
|
+
"in": "body"
|
|
4117
|
+
},
|
|
4118
|
+
{
|
|
4119
|
+
"name": "modes",
|
|
4120
|
+
"description": "Which Discord Gateway flows this channel serves; null for non-Discord channels. At least one must be enabled.\n* `dms` — the bot converses 1:1 in direct messages (the WhatsApp shape).\n Needs only the non-privileged `DIRECT_MESSAGES` intent.\n\n* `mention_threads` — an @mention in a server opens a thread, and the\n whole thread is one conversation. Reading the follow-up messages in\n the thread needs the **privileged** `MESSAGE_CONTENT` intent, which\n you enable on your own Discord app (Discord requires bot verification\n past ~100 servers), so it is off unless you ask for it.\n",
|
|
3523
4121
|
"required": false,
|
|
3524
4122
|
"type": "object",
|
|
3525
4123
|
"in": "body"
|
|
@@ -3533,10 +4131,10 @@ const routes = {
|
|
|
3533
4131
|
}
|
|
3534
4132
|
]
|
|
3535
4133
|
},
|
|
3536
|
-
"delete-channel
|
|
4134
|
+
"delete-channel": {
|
|
3537
4135
|
serviceClass: "Channels",
|
|
3538
|
-
operationId: "
|
|
3539
|
-
description: "
|
|
4136
|
+
operationId: "deleteChannel",
|
|
4137
|
+
description: "Deletes the channel and whatever it provisioned — the WhatsApp send tool and write-only credential secret, or the Discord channel's sealed bot token (dropped with the row, closing its gateway connection).",
|
|
3540
4138
|
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channels",
|
|
3541
4139
|
httpMethod: "delete",
|
|
3542
4140
|
pathParams: ["project_id", "channel_id"],
|