@meetkai/mka1 0.49.11 → 0.49.12

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.
Files changed (110) hide show
  1. package/bin/mcp-server.js +126 -30
  2. package/bin/mcp-server.js.map +17 -15
  3. package/dist/commonjs/funcs/agentConnectorsActivateAgentConnector.d.ts +1 -1
  4. package/dist/commonjs/funcs/agentConnectorsActivateAgentConnector.js +1 -1
  5. package/dist/commonjs/funcs/agentConnectorsCreateAgentConnector.d.ts +1 -1
  6. package/dist/commonjs/funcs/agentConnectorsCreateAgentConnector.js +1 -1
  7. package/dist/commonjs/funcs/agentConnectorsDeleteAgentConnector.d.ts +1 -1
  8. package/dist/commonjs/funcs/agentConnectorsDeleteAgentConnector.js +1 -1
  9. package/dist/commonjs/lib/config.d.ts +2 -2
  10. package/dist/commonjs/lib/config.js +2 -2
  11. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  12. package/dist/commonjs/mcp-server/server.js +1 -1
  13. package/dist/commonjs/mcp-server/tools/agentConnectorsActivateAgentConnector.js +1 -1
  14. package/dist/commonjs/mcp-server/tools/agentConnectorsActivateAgentConnector.js.map +1 -1
  15. package/dist/commonjs/mcp-server/tools/agentConnectorsCreateAgentConnector.js +1 -1
  16. package/dist/commonjs/mcp-server/tools/agentConnectorsCreateAgentConnector.js.map +1 -1
  17. package/dist/commonjs/mcp-server/tools/agentConnectorsDeleteAgentConnector.js +1 -1
  18. package/dist/commonjs/mcp-server/tools/agentConnectorsDeleteAgentConnector.js.map +1 -1
  19. package/dist/commonjs/models/components/agentconnector.d.ts +3 -2
  20. package/dist/commonjs/models/components/agentconnector.d.ts.map +1 -1
  21. package/dist/commonjs/models/components/agentconnector.js +1 -0
  22. package/dist/commonjs/models/components/agentconnector.js.map +1 -1
  23. package/dist/commonjs/models/components/createagentconnectorrequest.d.ts +4 -80
  24. package/dist/commonjs/models/components/createagentconnectorrequest.d.ts.map +1 -1
  25. package/dist/commonjs/models/components/createagentconnectorrequest.js +13 -93
  26. package/dist/commonjs/models/components/createagentconnectorrequest.js.map +1 -1
  27. package/dist/commonjs/models/components/createtelegramagentconnectorrequest.d.ts +77 -0
  28. package/dist/commonjs/models/components/createtelegramagentconnectorrequest.d.ts.map +1 -0
  29. package/dist/commonjs/models/components/createtelegramagentconnectorrequest.js +133 -0
  30. package/dist/commonjs/models/components/createtelegramagentconnectorrequest.js.map +1 -0
  31. package/dist/commonjs/models/components/createwhatsappagentconnectorrequest.d.ts +99 -0
  32. package/dist/commonjs/models/components/createwhatsappagentconnectorrequest.d.ts.map +1 -0
  33. package/dist/commonjs/models/components/createwhatsappagentconnectorrequest.js +161 -0
  34. package/dist/commonjs/models/components/createwhatsappagentconnectorrequest.js.map +1 -0
  35. package/dist/commonjs/models/components/index.d.ts +2 -0
  36. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  37. package/dist/commonjs/models/components/index.js +2 -0
  38. package/dist/commonjs/models/components/index.js.map +1 -1
  39. package/dist/commonjs/react-query/agentConnectorsActivateAgentConnector.d.ts +1 -1
  40. package/dist/commonjs/react-query/agentConnectorsActivateAgentConnector.js +1 -1
  41. package/dist/commonjs/react-query/agentConnectorsCreateAgentConnector.d.ts +1 -1
  42. package/dist/commonjs/react-query/agentConnectorsCreateAgentConnector.js +1 -1
  43. package/dist/commonjs/react-query/agentConnectorsDeleteAgentConnector.d.ts +1 -1
  44. package/dist/commonjs/react-query/agentConnectorsDeleteAgentConnector.js +1 -1
  45. package/dist/commonjs/sdk/agentconnectors.d.ts +3 -3
  46. package/dist/commonjs/sdk/agentconnectors.js +3 -3
  47. package/dist/esm/funcs/agentConnectorsActivateAgentConnector.d.ts +1 -1
  48. package/dist/esm/funcs/agentConnectorsActivateAgentConnector.js +1 -1
  49. package/dist/esm/funcs/agentConnectorsCreateAgentConnector.d.ts +1 -1
  50. package/dist/esm/funcs/agentConnectorsCreateAgentConnector.js +1 -1
  51. package/dist/esm/funcs/agentConnectorsDeleteAgentConnector.d.ts +1 -1
  52. package/dist/esm/funcs/agentConnectorsDeleteAgentConnector.js +1 -1
  53. package/dist/esm/lib/config.d.ts +2 -2
  54. package/dist/esm/lib/config.js +2 -2
  55. package/dist/esm/mcp-server/mcp-server.js +1 -1
  56. package/dist/esm/mcp-server/server.js +1 -1
  57. package/dist/esm/mcp-server/tools/agentConnectorsActivateAgentConnector.js +1 -1
  58. package/dist/esm/mcp-server/tools/agentConnectorsActivateAgentConnector.js.map +1 -1
  59. package/dist/esm/mcp-server/tools/agentConnectorsCreateAgentConnector.js +1 -1
  60. package/dist/esm/mcp-server/tools/agentConnectorsCreateAgentConnector.js.map +1 -1
  61. package/dist/esm/mcp-server/tools/agentConnectorsDeleteAgentConnector.js +1 -1
  62. package/dist/esm/mcp-server/tools/agentConnectorsDeleteAgentConnector.js.map +1 -1
  63. package/dist/esm/models/components/agentconnector.d.ts +3 -2
  64. package/dist/esm/models/components/agentconnector.d.ts.map +1 -1
  65. package/dist/esm/models/components/agentconnector.js +1 -0
  66. package/dist/esm/models/components/agentconnector.js.map +1 -1
  67. package/dist/esm/models/components/createagentconnectorrequest.d.ts +4 -80
  68. package/dist/esm/models/components/createagentconnectorrequest.d.ts.map +1 -1
  69. package/dist/esm/models/components/createagentconnectorrequest.js +12 -88
  70. package/dist/esm/models/components/createagentconnectorrequest.js.map +1 -1
  71. package/dist/esm/models/components/createtelegramagentconnectorrequest.d.ts +77 -0
  72. package/dist/esm/models/components/createtelegramagentconnectorrequest.d.ts.map +1 -0
  73. package/dist/esm/models/components/createtelegramagentconnectorrequest.js +91 -0
  74. package/dist/esm/models/components/createtelegramagentconnectorrequest.js.map +1 -0
  75. package/dist/esm/models/components/createwhatsappagentconnectorrequest.d.ts +99 -0
  76. package/dist/esm/models/components/createwhatsappagentconnectorrequest.d.ts.map +1 -0
  77. package/dist/esm/models/components/createwhatsappagentconnectorrequest.js +117 -0
  78. package/dist/esm/models/components/createwhatsappagentconnectorrequest.js.map +1 -0
  79. package/dist/esm/models/components/index.d.ts +2 -0
  80. package/dist/esm/models/components/index.d.ts.map +1 -1
  81. package/dist/esm/models/components/index.js +2 -0
  82. package/dist/esm/models/components/index.js.map +1 -1
  83. package/dist/esm/react-query/agentConnectorsActivateAgentConnector.d.ts +1 -1
  84. package/dist/esm/react-query/agentConnectorsActivateAgentConnector.js +1 -1
  85. package/dist/esm/react-query/agentConnectorsCreateAgentConnector.d.ts +1 -1
  86. package/dist/esm/react-query/agentConnectorsCreateAgentConnector.js +1 -1
  87. package/dist/esm/react-query/agentConnectorsDeleteAgentConnector.d.ts +1 -1
  88. package/dist/esm/react-query/agentConnectorsDeleteAgentConnector.js +1 -1
  89. package/dist/esm/sdk/agentconnectors.d.ts +3 -3
  90. package/dist/esm/sdk/agentconnectors.js +3 -3
  91. package/jsr.json +1 -1
  92. package/package.json +1 -1
  93. package/src/funcs/agentConnectorsActivateAgentConnector.ts +1 -1
  94. package/src/funcs/agentConnectorsCreateAgentConnector.ts +1 -1
  95. package/src/funcs/agentConnectorsDeleteAgentConnector.ts +1 -1
  96. package/src/lib/config.ts +2 -2
  97. package/src/mcp-server/mcp-server.ts +1 -1
  98. package/src/mcp-server/server.ts +1 -1
  99. package/src/mcp-server/tools/agentConnectorsActivateAgentConnector.ts +1 -1
  100. package/src/mcp-server/tools/agentConnectorsCreateAgentConnector.ts +1 -1
  101. package/src/mcp-server/tools/agentConnectorsDeleteAgentConnector.ts +1 -1
  102. package/src/models/components/agentconnector.ts +3 -2
  103. package/src/models/components/createagentconnectorrequest.ts +27 -196
  104. package/src/models/components/createtelegramagentconnectorrequest.ts +225 -0
  105. package/src/models/components/createwhatsappagentconnectorrequest.ts +301 -0
  106. package/src/models/components/index.ts +2 -0
  107. package/src/react-query/agentConnectorsActivateAgentConnector.ts +1 -1
  108. package/src/react-query/agentConnectorsCreateAgentConnector.ts +1 -1
  109. package/src/react-query/agentConnectorsDeleteAgentConnector.ts +1 -1
  110. package/src/sdk/agentconnectors.ts +3 -3
@@ -22,7 +22,7 @@ export class AgentConnectors extends ClientSDK {
22
22
  * Create a connector
23
23
  *
24
24
  * @remarks
25
- * Connects the agent to a Telegram bot, validates the bot token, and registers the agent's webhook. Telegram text, photos, and gateway-supported documents can invoke the agent; inbound media additionally requires write:files. Managed outbound files require read:files, and generated images require both file scopes so their transient provider URLs can be materialized before delivery. The optional write:feedback scope enables native thumbs reaction synchronization to gateway response feedback. These conditional scopes are deliberately not part of x-required-scopes because text-only connectors do not need them. An API key with every listed scope is required; its identity tuple and current scopes are stored as a non-widening ceiling, then revalidated with mk-authentication before every connector run; session and delegated end-user contexts are rejected. The required access policy controls which Telegram chats may invoke the agent.
25
+ * Connects the agent to a Telegram bot or WhatsApp Business phone number, validates the provider credentials, and registers the agent's webhook. Text, photos, and gateway-supported documents can invoke the agent; inbound media additionally requires write:files. Managed outbound files require read:files, and generated images require both file scopes so their transient provider URLs can be materialized before delivery. The optional write:feedback scope enables native thumbs reaction synchronization to gateway response feedback. These conditional scopes are deliberately not part of x-required-scopes because text-only connectors do not need them. An API key with every listed scope is required; its identity tuple and current scopes are stored as a non-widening ceiling, then revalidated with mk-authentication before every connector run; session and delegated end-user contexts are rejected. The required access policy controls which provider users or chats may invoke the agent.
26
26
  */
27
27
  async createAgentConnector(request, options) {
28
28
  return unwrapAsync(agentConnectorsCreateAgentConnector(this, request, options));
@@ -40,7 +40,7 @@ export class AgentConnectors extends ClientSDK {
40
40
  * Delete a connector
41
41
  *
42
42
  * @remarks
43
- * Unregisters the provider webhook, drops its pending Telegram updates, and deletes the stored connector credentials.
43
+ * Unregisters the connector-specific provider webhook and deletes the stored connector credentials. Telegram pending updates are dropped; WhatsApp deletion clears only the phone-number callback and does not unsubscribe other numbers in the business account.
44
44
  */
45
45
  async deleteAgentConnector(request, options) {
46
46
  return unwrapAsync(agentConnectorsDeleteAgentConnector(this, request, options));
@@ -49,7 +49,7 @@ export class AgentConnectors extends ClientSDK {
49
49
  * Activate a connector
50
50
  *
51
51
  * @remarks
52
- * Revalidates the stored Telegram credentials and registers the provider webhook. Use this to retry a connector left in an error state or rotate its key. API-key authentication with every listed scope is required; session authentication is rejected, and the new key must belong to the connector's original user or service-account principal so existing conversations keep the same owner.
52
+ * Revalidates the stored provider credentials and registers the provider webhook. Use this to retry a connector left in an error state. API-key authentication with every listed scope is required; session authentication is rejected, and the key must belong to the connector's original user or service-account principal so existing conversations keep the same owner.
53
53
  */
54
54
  async activateAgentConnector(request, options) {
55
55
  return unwrapAsync(agentConnectorsActivateAgentConnector(this, request, options));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@meetkai/mka1",
5
- "version": "0.49.11",
5
+ "version": "0.49.12",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetkai/mka1",
3
- "version": "0.49.11",
3
+ "version": "0.49.12",
4
4
  "author": "Daniel Wilder <dauncy@gmail.com>",
5
5
  "homepage": "https://docs.mka1.com",
6
6
  "publishConfig": {
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  * Activate a connector
32
32
  *
33
33
  * @remarks
34
- * Revalidates the stored Telegram credentials and registers the provider webhook. Use this to retry a connector left in an error state or rotate its key. API-key authentication with every listed scope is required; session authentication is rejected, and the new key must belong to the connector's original user or service-account principal so existing conversations keep the same owner.
34
+ * Revalidates the stored provider credentials and registers the provider webhook. Use this to retry a connector left in an error state. API-key authentication with every listed scope is required; session authentication is rejected, and the key must belong to the connector's original user or service-account principal so existing conversations keep the same owner.
35
35
  */
36
36
  export function agentConnectorsActivateAgentConnector(
37
37
  client: SDKCore,
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  * Create a connector
32
32
  *
33
33
  * @remarks
34
- * Connects the agent to a Telegram bot, validates the bot token, and registers the agent's webhook. Telegram text, photos, and gateway-supported documents can invoke the agent; inbound media additionally requires write:files. Managed outbound files require read:files, and generated images require both file scopes so their transient provider URLs can be materialized before delivery. The optional write:feedback scope enables native thumbs reaction synchronization to gateway response feedback. These conditional scopes are deliberately not part of x-required-scopes because text-only connectors do not need them. An API key with every listed scope is required; its identity tuple and current scopes are stored as a non-widening ceiling, then revalidated with mk-authentication before every connector run; session and delegated end-user contexts are rejected. The required access policy controls which Telegram chats may invoke the agent.
34
+ * Connects the agent to a Telegram bot or WhatsApp Business phone number, validates the provider credentials, and registers the agent's webhook. Text, photos, and gateway-supported documents can invoke the agent; inbound media additionally requires write:files. Managed outbound files require read:files, and generated images require both file scopes so their transient provider URLs can be materialized before delivery. The optional write:feedback scope enables native thumbs reaction synchronization to gateway response feedback. These conditional scopes are deliberately not part of x-required-scopes because text-only connectors do not need them. An API key with every listed scope is required; its identity tuple and current scopes are stored as a non-widening ceiling, then revalidated with mk-authentication before every connector run; session and delegated end-user contexts are rejected. The required access policy controls which provider users or chats may invoke the agent.
35
35
  */
36
36
  export function agentConnectorsCreateAgentConnector(
37
37
  client: SDKCore,
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  * Delete a connector
32
32
  *
33
33
  * @remarks
34
- * Unregisters the provider webhook, drops its pending Telegram updates, and deletes the stored connector credentials.
34
+ * Unregisters the connector-specific provider webhook and deletes the stored connector credentials. Telegram pending updates are dropped; WhatsApp deletion clears only the phone-number callback and does not unsubscribe other numbers in the business account.
35
35
  */
36
36
  export function agentConnectorsDeleteAgentConnector(
37
37
  client: SDKCore,
package/src/lib/config.ts CHANGED
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
65
65
  export const SDK_METADATA = {
66
66
  language: "typescript",
67
67
  openapiDocVersion: "1.1.0",
68
- sdkVersion: "0.49.11",
68
+ sdkVersion: "0.49.12",
69
69
  genVersion: "2.918.3",
70
- userAgent: "speakeasy-sdk/typescript 0.49.11 2.918.3 1.1.0 @meetkai/mka1",
70
+ userAgent: "speakeasy-sdk/typescript 0.49.12 2.918.3 1.1.0 @meetkai/mka1",
71
71
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.49.11",
22
+ currentVersion: "0.49.12",
23
23
  },
24
24
  });
25
25
 
@@ -345,7 +345,7 @@ export function createMCPServer(deps: {
345
345
  }) {
346
346
  const server = new McpServer({
347
347
  name: "SDK",
348
- version: "0.49.11",
348
+ version: "0.49.12",
349
349
  });
350
350
 
351
351
  const client = new SDKCore({
@@ -16,7 +16,7 @@ export const tool$agentConnectorsActivateAgentConnector: ToolDefinition<
16
16
  name: "agent-connectors-activate-agent-connector",
17
17
  description: `Activate a connector
18
18
 
19
- Revalidates the stored Telegram credentials and registers the provider webhook. Use this to retry a connector left in an error state or rotate its key. API-key authentication with every listed scope is required; session authentication is rejected, and the new key must belong to the connector's original user or service-account principal so existing conversations keep the same owner.`,
19
+ Revalidates the stored provider credentials and registers the provider webhook. Use this to retry a connector left in an error state. API-key authentication with every listed scope is required; session authentication is rejected, and the key must belong to the connector's original user or service-account principal so existing conversations keep the same owner.`,
20
20
  args,
21
21
  tool: async (client, args, ctx) => {
22
22
  const [result, apiCall] = await agentConnectorsActivateAgentConnector(
@@ -16,7 +16,7 @@ export const tool$agentConnectorsCreateAgentConnector: ToolDefinition<
16
16
  name: "agent-connectors-create-agent-connector",
17
17
  description: `Create a connector
18
18
 
19
- Connects the agent to a Telegram bot, validates the bot token, and registers the agent's webhook. Telegram text, photos, and gateway-supported documents can invoke the agent; inbound media additionally requires write:files. Managed outbound files require read:files, and generated images require both file scopes so their transient provider URLs can be materialized before delivery. The optional write:feedback scope enables native thumbs reaction synchronization to gateway response feedback. These conditional scopes are deliberately not part of x-required-scopes because text-only connectors do not need them. An API key with every listed scope is required; its identity tuple and current scopes are stored as a non-widening ceiling, then revalidated with mk-authentication before every connector run; session and delegated end-user contexts are rejected. The required access policy controls which Telegram chats may invoke the agent.`,
19
+ Connects the agent to a Telegram bot or WhatsApp Business phone number, validates the provider credentials, and registers the agent's webhook. Text, photos, and gateway-supported documents can invoke the agent; inbound media additionally requires write:files. Managed outbound files require read:files, and generated images require both file scopes so their transient provider URLs can be materialized before delivery. The optional write:feedback scope enables native thumbs reaction synchronization to gateway response feedback. These conditional scopes are deliberately not part of x-required-scopes because text-only connectors do not need them. An API key with every listed scope is required; its identity tuple and current scopes are stored as a non-widening ceiling, then revalidated with mk-authentication before every connector run; session and delegated end-user contexts are rejected. The required access policy controls which provider users or chats may invoke the agent.`,
20
20
  args,
21
21
  tool: async (client, args, ctx) => {
22
22
  const [result, apiCall] = await agentConnectorsCreateAgentConnector(
@@ -16,7 +16,7 @@ export const tool$agentConnectorsDeleteAgentConnector: ToolDefinition<
16
16
  name: "agent-connectors-delete-agent-connector",
17
17
  description: `Delete a connector
18
18
 
19
- Unregisters the provider webhook, drops its pending Telegram updates, and deletes the stored connector credentials.`,
19
+ Unregisters the connector-specific provider webhook and deletes the stored connector credentials. Telegram pending updates are dropped; WhatsApp deletion clears only the phone-number callback and does not unsubscribe other numbers in the business account.`,
20
20
  args,
21
21
  tool: async (client, args, ctx) => {
22
22
  const [result, apiCall] = await agentConnectorsDeleteAgentConnector(
@@ -22,6 +22,7 @@ export type AgentConnectorObject = ClosedEnum<typeof AgentConnectorObject>;
22
22
 
23
23
  export const Provider = {
24
24
  Telegram: "telegram",
25
+ Whatsapp: "whatsapp",
25
26
  } as const;
26
27
  export type Provider = ClosedEnum<typeof Provider>;
27
28
 
@@ -36,11 +37,11 @@ export type AgentConnector = {
36
37
  */
37
38
  status: string;
38
39
  /**
39
- * The Telegram bot user ID.
40
+ * The provider account ID: Telegram bot user ID or WhatsApp phone-number ID.
40
41
  */
41
42
  providerAccountId: string;
42
43
  /**
43
- * The Telegram bot username when one is available.
44
+ * Provider account display name when one is available.
44
45
  */
45
46
  providerAccountName: string | null;
46
47
  config: JsonValue | null;
@@ -3,218 +3,49 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
6
  import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
7
  import { Result as SafeParseResult } from "../../types/fp.js";
10
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
-
12
- /**
13
- * Telegram Bot API connector. Supports text, photos up to the Bot API's 20 MiB download limit, gateway-supported documents, and response feedback through native thumbs reactions.
14
- */
15
- export const CreateAgentConnectorRequestProvider = {
16
- Telegram: "telegram",
17
- } as const;
18
- /**
19
- * Telegram Bot API connector. Supports text, photos up to the Bot API's 20 MiB download limit, gateway-supported documents, and response feedback through native thumbs reactions.
20
- */
21
- export type CreateAgentConnectorRequestProvider = ClosedEnum<
22
- typeof CreateAgentConnectorRequestProvider
23
- >;
24
-
25
- export type Credentials = {
26
- /**
27
- * Telegram bot token issued by BotFather. It is encrypted at rest and is never returned by the API.
28
- */
29
- botToken: string;
30
- };
31
-
32
- export const CreateAgentConnectorRequestMode = {
33
- Allowlist: "allowlist",
34
- } as const;
35
- export type CreateAgentConnectorRequestMode = ClosedEnum<
36
- typeof CreateAgentConnectorRequestMode
37
- >;
38
-
39
- /**
40
- * The explicit Telegram chat allowlist permitted to invoke the agent.
41
- */
42
- export type CreateAgentConnectorRequestAccess = {
43
- mode: CreateAgentConnectorRequestMode;
44
- chatIds: Array<number>;
45
- };
46
-
47
- export type CreateAgentConnectorRequest = {
48
- /**
49
- * Telegram Bot API connector. Supports text, photos up to the Bot API's 20 MiB download limit, gateway-supported documents, and response feedback through native thumbs reactions.
50
- */
51
- provider: CreateAgentConnectorRequestProvider;
52
- name?: string | undefined;
53
- credentials: Credentials;
54
- /**
55
- * The explicit Telegram chat allowlist permitted to invoke the agent.
56
- */
57
- access: CreateAgentConnectorRequestAccess;
58
- /**
59
- * Always true: Telegram discards updates queued before this tenancy's webhook is registered.
60
- */
61
- dropPendingUpdates?: true | undefined;
62
- };
63
-
64
- /** @internal */
65
- export const CreateAgentConnectorRequestProvider$inboundSchema: z.ZodNativeEnum<
66
- typeof CreateAgentConnectorRequestProvider
67
- > = z.nativeEnum(CreateAgentConnectorRequestProvider);
68
- /** @internal */
69
- export const CreateAgentConnectorRequestProvider$outboundSchema:
70
- z.ZodNativeEnum<typeof CreateAgentConnectorRequestProvider> =
71
- CreateAgentConnectorRequestProvider$inboundSchema;
72
-
73
- /** @internal */
74
- export const Credentials$inboundSchema: z.ZodType<
75
- Credentials,
76
- z.ZodTypeDef,
77
- unknown
78
- > = z.object({
79
- bot_token: z.string(),
80
- }).transform((v) => {
81
- return remap$(v, {
82
- "bot_token": "botToken",
83
- });
84
- });
85
- /** @internal */
86
- export type Credentials$Outbound = {
87
- bot_token: string;
88
- };
89
-
90
- /** @internal */
91
- export const Credentials$outboundSchema: z.ZodType<
92
- Credentials$Outbound,
93
- z.ZodTypeDef,
94
- Credentials
95
- > = z.object({
96
- botToken: z.string(),
97
- }).transform((v) => {
98
- return remap$(v, {
99
- botToken: "bot_token",
100
- });
101
- });
102
-
103
- export function credentialsToJSON(credentials: Credentials): string {
104
- return JSON.stringify(Credentials$outboundSchema.parse(credentials));
105
- }
106
- export function credentialsFromJSON(
107
- jsonString: string,
108
- ): SafeParseResult<Credentials, SDKValidationError> {
109
- return safeParse(
110
- jsonString,
111
- (x) => Credentials$inboundSchema.parse(JSON.parse(x)),
112
- `Failed to parse 'Credentials' from JSON`,
113
- );
114
- }
115
-
116
- /** @internal */
117
- export const CreateAgentConnectorRequestMode$inboundSchema: z.ZodNativeEnum<
118
- typeof CreateAgentConnectorRequestMode
119
- > = z.nativeEnum(CreateAgentConnectorRequestMode);
120
- /** @internal */
121
- export const CreateAgentConnectorRequestMode$outboundSchema: z.ZodNativeEnum<
122
- typeof CreateAgentConnectorRequestMode
123
- > = CreateAgentConnectorRequestMode$inboundSchema;
124
-
125
- /** @internal */
126
- export const CreateAgentConnectorRequestAccess$inboundSchema: z.ZodType<
127
- CreateAgentConnectorRequestAccess,
128
- z.ZodTypeDef,
129
- unknown
130
- > = z.object({
131
- mode: CreateAgentConnectorRequestMode$inboundSchema,
132
- chat_ids: z.array(z.number().int()),
133
- }).transform((v) => {
134
- return remap$(v, {
135
- "chat_ids": "chatIds",
136
- });
137
- });
138
- /** @internal */
139
- export type CreateAgentConnectorRequestAccess$Outbound = {
140
- mode: string;
141
- chat_ids: Array<number>;
142
- };
143
-
144
- /** @internal */
145
- export const CreateAgentConnectorRequestAccess$outboundSchema: z.ZodType<
146
- CreateAgentConnectorRequestAccess$Outbound,
147
- z.ZodTypeDef,
148
- CreateAgentConnectorRequestAccess
149
- > = z.object({
150
- mode: CreateAgentConnectorRequestMode$outboundSchema,
151
- chatIds: z.array(z.number().int()),
152
- }).transform((v) => {
153
- return remap$(v, {
154
- chatIds: "chat_ids",
155
- });
156
- });
157
-
158
- export function createAgentConnectorRequestAccessToJSON(
159
- createAgentConnectorRequestAccess: CreateAgentConnectorRequestAccess,
160
- ): string {
161
- return JSON.stringify(
162
- CreateAgentConnectorRequestAccess$outboundSchema.parse(
163
- createAgentConnectorRequestAccess,
164
- ),
165
- );
166
- }
167
- export function createAgentConnectorRequestAccessFromJSON(
168
- jsonString: string,
169
- ): SafeParseResult<CreateAgentConnectorRequestAccess, SDKValidationError> {
170
- return safeParse(
171
- jsonString,
172
- (x) => CreateAgentConnectorRequestAccess$inboundSchema.parse(JSON.parse(x)),
173
- `Failed to parse 'CreateAgentConnectorRequestAccess' from JSON`,
174
- );
175
- }
9
+ import {
10
+ CreateTelegramAgentConnectorRequest,
11
+ CreateTelegramAgentConnectorRequest$inboundSchema,
12
+ CreateTelegramAgentConnectorRequest$Outbound,
13
+ CreateTelegramAgentConnectorRequest$outboundSchema,
14
+ } from "./createtelegramagentconnectorrequest.js";
15
+ import {
16
+ CreateWhatsAppAgentConnectorRequest,
17
+ CreateWhatsAppAgentConnectorRequest$inboundSchema,
18
+ CreateWhatsAppAgentConnectorRequest$Outbound,
19
+ CreateWhatsAppAgentConnectorRequest$outboundSchema,
20
+ } from "./createwhatsappagentconnectorrequest.js";
21
+
22
+ export type CreateAgentConnectorRequest =
23
+ | CreateTelegramAgentConnectorRequest
24
+ | CreateWhatsAppAgentConnectorRequest;
176
25
 
177
26
  /** @internal */
178
27
  export const CreateAgentConnectorRequest$inboundSchema: z.ZodType<
179
28
  CreateAgentConnectorRequest,
180
29
  z.ZodTypeDef,
181
30
  unknown
182
- > = z.object({
183
- provider: CreateAgentConnectorRequestProvider$inboundSchema,
184
- name: z.string().optional(),
185
- credentials: z.lazy(() => Credentials$inboundSchema),
186
- access: z.lazy(() => CreateAgentConnectorRequestAccess$inboundSchema),
187
- drop_pending_updates: z.literal(true).default(true),
188
- }).transform((v) => {
189
- return remap$(v, {
190
- "drop_pending_updates": "dropPendingUpdates",
191
- });
192
- });
31
+ > = z.union([
32
+ CreateTelegramAgentConnectorRequest$inboundSchema,
33
+ CreateWhatsAppAgentConnectorRequest$inboundSchema,
34
+ ]);
193
35
  /** @internal */
194
- export type CreateAgentConnectorRequest$Outbound = {
195
- provider: string;
196
- name?: string | undefined;
197
- credentials: Credentials$Outbound;
198
- access: CreateAgentConnectorRequestAccess$Outbound;
199
- drop_pending_updates: true;
200
- };
36
+ export type CreateAgentConnectorRequest$Outbound =
37
+ | CreateTelegramAgentConnectorRequest$Outbound
38
+ | CreateWhatsAppAgentConnectorRequest$Outbound;
201
39
 
202
40
  /** @internal */
203
41
  export const CreateAgentConnectorRequest$outboundSchema: z.ZodType<
204
42
  CreateAgentConnectorRequest$Outbound,
205
43
  z.ZodTypeDef,
206
44
  CreateAgentConnectorRequest
207
- > = z.object({
208
- provider: CreateAgentConnectorRequestProvider$outboundSchema,
209
- name: z.string().optional(),
210
- credentials: z.lazy(() => Credentials$outboundSchema),
211
- access: z.lazy(() => CreateAgentConnectorRequestAccess$outboundSchema),
212
- dropPendingUpdates: z.literal(true).default(true as const),
213
- }).transform((v) => {
214
- return remap$(v, {
215
- dropPendingUpdates: "drop_pending_updates",
216
- });
217
- });
45
+ > = z.union([
46
+ CreateTelegramAgentConnectorRequest$outboundSchema,
47
+ CreateWhatsAppAgentConnectorRequest$outboundSchema,
48
+ ]);
218
49
 
219
50
  export function createAgentConnectorRequestToJSON(
220
51
  createAgentConnectorRequest: CreateAgentConnectorRequest,
@@ -0,0 +1,225 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type Credentials = {
13
+ /**
14
+ * Telegram bot token issued by BotFather. It is encrypted at rest and is never returned by the API.
15
+ */
16
+ botToken: string;
17
+ };
18
+
19
+ export const CreateTelegramAgentConnectorRequestMode = {
20
+ Allowlist: "allowlist",
21
+ } as const;
22
+ export type CreateTelegramAgentConnectorRequestMode = ClosedEnum<
23
+ typeof CreateTelegramAgentConnectorRequestMode
24
+ >;
25
+
26
+ /**
27
+ * The explicit Telegram chat allowlist permitted to invoke the agent.
28
+ */
29
+ export type CreateTelegramAgentConnectorRequestAccess = {
30
+ mode: CreateTelegramAgentConnectorRequestMode;
31
+ chatIds: Array<number>;
32
+ };
33
+
34
+ export type CreateTelegramAgentConnectorRequest = {
35
+ /**
36
+ * Telegram Bot API connector. Supports text, photos up to the Bot API's 20 MiB download limit, gateway-supported documents, and response feedback through native thumbs reactions.
37
+ */
38
+ provider: "telegram";
39
+ name?: string | undefined;
40
+ credentials: Credentials;
41
+ /**
42
+ * The explicit Telegram chat allowlist permitted to invoke the agent.
43
+ */
44
+ access: CreateTelegramAgentConnectorRequestAccess;
45
+ /**
46
+ * Always true: Telegram discards updates queued before this tenancy's webhook is registered.
47
+ */
48
+ dropPendingUpdates?: true | undefined;
49
+ };
50
+
51
+ /** @internal */
52
+ export const Credentials$inboundSchema: z.ZodType<
53
+ Credentials,
54
+ z.ZodTypeDef,
55
+ unknown
56
+ > = z.object({
57
+ bot_token: z.string(),
58
+ }).transform((v) => {
59
+ return remap$(v, {
60
+ "bot_token": "botToken",
61
+ });
62
+ });
63
+ /** @internal */
64
+ export type Credentials$Outbound = {
65
+ bot_token: string;
66
+ };
67
+
68
+ /** @internal */
69
+ export const Credentials$outboundSchema: z.ZodType<
70
+ Credentials$Outbound,
71
+ z.ZodTypeDef,
72
+ Credentials
73
+ > = z.object({
74
+ botToken: z.string(),
75
+ }).transform((v) => {
76
+ return remap$(v, {
77
+ botToken: "bot_token",
78
+ });
79
+ });
80
+
81
+ export function credentialsToJSON(credentials: Credentials): string {
82
+ return JSON.stringify(Credentials$outboundSchema.parse(credentials));
83
+ }
84
+ export function credentialsFromJSON(
85
+ jsonString: string,
86
+ ): SafeParseResult<Credentials, SDKValidationError> {
87
+ return safeParse(
88
+ jsonString,
89
+ (x) => Credentials$inboundSchema.parse(JSON.parse(x)),
90
+ `Failed to parse 'Credentials' from JSON`,
91
+ );
92
+ }
93
+
94
+ /** @internal */
95
+ export const CreateTelegramAgentConnectorRequestMode$inboundSchema:
96
+ z.ZodNativeEnum<typeof CreateTelegramAgentConnectorRequestMode> = z
97
+ .nativeEnum(CreateTelegramAgentConnectorRequestMode);
98
+ /** @internal */
99
+ export const CreateTelegramAgentConnectorRequestMode$outboundSchema:
100
+ z.ZodNativeEnum<typeof CreateTelegramAgentConnectorRequestMode> =
101
+ CreateTelegramAgentConnectorRequestMode$inboundSchema;
102
+
103
+ /** @internal */
104
+ export const CreateTelegramAgentConnectorRequestAccess$inboundSchema: z.ZodType<
105
+ CreateTelegramAgentConnectorRequestAccess,
106
+ z.ZodTypeDef,
107
+ unknown
108
+ > = z.object({
109
+ mode: CreateTelegramAgentConnectorRequestMode$inboundSchema,
110
+ chat_ids: z.array(z.number().int()),
111
+ }).transform((v) => {
112
+ return remap$(v, {
113
+ "chat_ids": "chatIds",
114
+ });
115
+ });
116
+ /** @internal */
117
+ export type CreateTelegramAgentConnectorRequestAccess$Outbound = {
118
+ mode: string;
119
+ chat_ids: Array<number>;
120
+ };
121
+
122
+ /** @internal */
123
+ export const CreateTelegramAgentConnectorRequestAccess$outboundSchema:
124
+ z.ZodType<
125
+ CreateTelegramAgentConnectorRequestAccess$Outbound,
126
+ z.ZodTypeDef,
127
+ CreateTelegramAgentConnectorRequestAccess
128
+ > = z.object({
129
+ mode: CreateTelegramAgentConnectorRequestMode$outboundSchema,
130
+ chatIds: z.array(z.number().int()),
131
+ }).transform((v) => {
132
+ return remap$(v, {
133
+ chatIds: "chat_ids",
134
+ });
135
+ });
136
+
137
+ export function createTelegramAgentConnectorRequestAccessToJSON(
138
+ createTelegramAgentConnectorRequestAccess:
139
+ CreateTelegramAgentConnectorRequestAccess,
140
+ ): string {
141
+ return JSON.stringify(
142
+ CreateTelegramAgentConnectorRequestAccess$outboundSchema.parse(
143
+ createTelegramAgentConnectorRequestAccess,
144
+ ),
145
+ );
146
+ }
147
+ export function createTelegramAgentConnectorRequestAccessFromJSON(
148
+ jsonString: string,
149
+ ): SafeParseResult<
150
+ CreateTelegramAgentConnectorRequestAccess,
151
+ SDKValidationError
152
+ > {
153
+ return safeParse(
154
+ jsonString,
155
+ (x) =>
156
+ CreateTelegramAgentConnectorRequestAccess$inboundSchema.parse(
157
+ JSON.parse(x),
158
+ ),
159
+ `Failed to parse 'CreateTelegramAgentConnectorRequestAccess' from JSON`,
160
+ );
161
+ }
162
+
163
+ /** @internal */
164
+ export const CreateTelegramAgentConnectorRequest$inboundSchema: z.ZodType<
165
+ CreateTelegramAgentConnectorRequest,
166
+ z.ZodTypeDef,
167
+ unknown
168
+ > = z.object({
169
+ provider: z.literal("telegram"),
170
+ name: z.string().optional(),
171
+ credentials: z.lazy(() => Credentials$inboundSchema),
172
+ access: z.lazy(() => CreateTelegramAgentConnectorRequestAccess$inboundSchema),
173
+ drop_pending_updates: z.literal(true).default(true),
174
+ }).transform((v) => {
175
+ return remap$(v, {
176
+ "drop_pending_updates": "dropPendingUpdates",
177
+ });
178
+ });
179
+ /** @internal */
180
+ export type CreateTelegramAgentConnectorRequest$Outbound = {
181
+ provider: "telegram";
182
+ name?: string | undefined;
183
+ credentials: Credentials$Outbound;
184
+ access: CreateTelegramAgentConnectorRequestAccess$Outbound;
185
+ drop_pending_updates: true;
186
+ };
187
+
188
+ /** @internal */
189
+ export const CreateTelegramAgentConnectorRequest$outboundSchema: z.ZodType<
190
+ CreateTelegramAgentConnectorRequest$Outbound,
191
+ z.ZodTypeDef,
192
+ CreateTelegramAgentConnectorRequest
193
+ > = z.object({
194
+ provider: z.literal("telegram"),
195
+ name: z.string().optional(),
196
+ credentials: z.lazy(() => Credentials$outboundSchema),
197
+ access: z.lazy(() =>
198
+ CreateTelegramAgentConnectorRequestAccess$outboundSchema
199
+ ),
200
+ dropPendingUpdates: z.literal(true).default(true as const),
201
+ }).transform((v) => {
202
+ return remap$(v, {
203
+ dropPendingUpdates: "drop_pending_updates",
204
+ });
205
+ });
206
+
207
+ export function createTelegramAgentConnectorRequestToJSON(
208
+ createTelegramAgentConnectorRequest: CreateTelegramAgentConnectorRequest,
209
+ ): string {
210
+ return JSON.stringify(
211
+ CreateTelegramAgentConnectorRequest$outboundSchema.parse(
212
+ createTelegramAgentConnectorRequest,
213
+ ),
214
+ );
215
+ }
216
+ export function createTelegramAgentConnectorRequestFromJSON(
217
+ jsonString: string,
218
+ ): SafeParseResult<CreateTelegramAgentConnectorRequest, SDKValidationError> {
219
+ return safeParse(
220
+ jsonString,
221
+ (x) =>
222
+ CreateTelegramAgentConnectorRequest$inboundSchema.parse(JSON.parse(x)),
223
+ `Failed to parse 'CreateTelegramAgentConnectorRequest' from JSON`,
224
+ );
225
+ }