broods 0.41.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -8,12 +8,17 @@ declare const AGENT_HOOK_EVENT_NAMES: readonly ["agent.started", "agent.step.fin
8
8
  type AgentHookEventName = (typeof AGENT_HOOK_EVENT_NAMES)[number];
9
9
 
10
10
  /**
11
- * Every Vercel AI SDK provider that ships language models, plus `custom`
12
- * (any OpenAI-compatible endpoint) and `minimax`. Image-, speech- and
13
- * transcription-only providers are deliberately absent: they cannot back
14
- * `config.model`.
11
+ * Every Vercel AI SDK provider that ships language models, the community
12
+ * providers on the same spec that take an API key (`cloudflare`, `llmgateway`,
13
+ * `ollama`, `openrouter`), and `custom` (any OpenAI-compatible endpoint).
14
+ * Image-, speech- and transcription-only providers are deliberately absent:
15
+ * they cannot back `config.model`.
15
16
  */
16
17
  declare const MODEL_PROVIDERS: {
18
+ readonly alibaba: {
19
+ readonly label: "Alibaba Qwen";
20
+ readonly modelPlaceholder: "qwen3-max";
21
+ };
17
22
  readonly anthropic: {
18
23
  readonly label: "Anthropic";
19
24
  readonly modelPlaceholder: "claude-sonnet-4-5-20250929";
@@ -34,6 +39,10 @@ declare const MODEL_PROVIDERS: {
34
39
  readonly label: "Cerebras";
35
40
  readonly modelPlaceholder: "llama3.1-8b";
36
41
  };
42
+ readonly cloudflare: {
43
+ readonly label: "Cloudflare Workers AI";
44
+ readonly modelPlaceholder: "@cf/meta/llama-3.3-70b-instruct-fp8-fast";
45
+ };
37
46
  readonly cohere: {
38
47
  readonly label: "Cohere";
39
48
  readonly modelPlaceholder: "command-a-03-2025";
@@ -62,6 +71,14 @@ declare const MODEL_PROVIDERS: {
62
71
  readonly label: "Groq";
63
72
  readonly modelPlaceholder: "llama-3.3-70b-versatile";
64
73
  };
74
+ readonly huggingface: {
75
+ readonly label: "Hugging Face";
76
+ readonly modelPlaceholder: "meta-llama/Llama-3.3-70B-Instruct";
77
+ };
78
+ readonly llmgateway: {
79
+ readonly label: "LLM Gateway";
80
+ readonly modelPlaceholder: "openai/gpt-4.1-mini";
81
+ };
65
82
  readonly minimax: {
66
83
  readonly label: "MiniMax";
67
84
  readonly modelPlaceholder: "MiniMax-M2.7";
@@ -70,10 +87,22 @@ declare const MODEL_PROVIDERS: {
70
87
  readonly label: "Mistral";
71
88
  readonly modelPlaceholder: "mistral-large-latest";
72
89
  };
90
+ readonly moonshotai: {
91
+ readonly label: "Moonshot AI Kimi";
92
+ readonly modelPlaceholder: "kimi-k2.6";
93
+ };
94
+ readonly ollama: {
95
+ readonly label: "Ollama";
96
+ readonly modelPlaceholder: "gpt-oss:120b";
97
+ };
73
98
  readonly openai: {
74
99
  readonly label: "OpenAI";
75
100
  readonly modelPlaceholder: "gpt-4.1-mini";
76
101
  };
102
+ readonly openrouter: {
103
+ readonly label: "OpenRouter";
104
+ readonly modelPlaceholder: "anthropic/claude-sonnet-4.5";
105
+ };
77
106
  readonly perplexity: {
78
107
  readonly label: "Perplexity";
79
108
  readonly modelPlaceholder: "low";
@@ -98,6 +127,10 @@ declare const MODEL_PROVIDERS: {
98
127
  readonly label: "xAI Grok";
99
128
  readonly modelPlaceholder: "grok-4";
100
129
  };
130
+ readonly zai: {
131
+ readonly label: "Z.ai GLM";
132
+ readonly modelPlaceholder: "glm-4.7";
133
+ };
101
134
  };
102
135
  type AccountModelProviderName = keyof typeof MODEL_PROVIDERS;
103
136
 
@@ -175,6 +208,24 @@ interface AgentConfig {
175
208
  allowRunOverrides?: boolean;
176
209
  [key: string]: unknown;
177
210
  }
211
+ /**
212
+ * What a code hook reads as ctx.config: the model and the names of what the
213
+ * agent can use. An allow-list, so no credential field can reach hook code.
214
+ */
215
+ interface HookAgentConfig {
216
+ readonly model: {
217
+ readonly provider?: AccountModelProviderName;
218
+ readonly modelId?: string;
219
+ };
220
+ readonly harness?: AgentHarnessConfig["type"];
221
+ readonly maxTurn?: number;
222
+ readonly tools: readonly string[];
223
+ readonly mcp: readonly string[];
224
+ readonly channels: readonly string[];
225
+ readonly skills: readonly string[];
226
+ readonly subagents: readonly string[];
227
+ readonly denyTools: readonly string[];
228
+ }
178
229
  interface AgentBehaviorConfig {
179
230
  maxTurn?: number;
180
231
  system?: string | SystemModelMessage | SystemModelMessage[];
@@ -347,12 +398,16 @@ interface AgentMcpEntry {
347
398
  }
348
399
  interface AgentChannelsConfig {
349
400
  telegram?: AgentTelegramChannelConfig;
401
+ gchat?: AgentGoogleChatChannelConfig;
350
402
  github?: AgentGitHubChannelConfig;
351
403
  slack?: AgentSlackChannelConfig;
352
404
  discord?: AgentDiscordChannelConfig;
353
405
  pancake?: AgentPancakeChannelConfig;
406
+ teams?: AgentTeamsChannelConfig;
407
+ twilio?: AgentTwilioChannelConfig;
354
408
  zalo?: AgentZaloChannelConfig;
355
409
  matrix?: AgentMatrixChannelConfig;
410
+ whatsapp?: AgentWhatsAppChannelConfig;
356
411
  [key: string]: unknown;
357
412
  }
358
413
  /**
@@ -477,6 +532,89 @@ interface AgentZaloChannelConfig {
477
532
  partition?: ChannelPartition;
478
533
  [key: string]: unknown;
479
534
  }
535
+ /**
536
+ * A Google Chat app on the HTTP endpoint connection. It posts as the service
537
+ * account in `credentials`, and a webhook is accepted when its Google-signed
538
+ * token names `endpointUrl` or `googleChatProjectNumber` as the audience.
539
+ */
540
+ interface AgentGoogleChatChannelConfig {
541
+ allowedChannelIds?: string[];
542
+ allowedUserIds?: string[];
543
+ id?: string;
544
+ /** The service-account key JSON, as downloaded from Google Cloud. */
545
+ credentials?: string;
546
+ /** Audience when the app authenticates with "HTTP endpoint URL". */
547
+ endpointUrl?: string;
548
+ /** Audience when the app authenticates with "Project number". */
549
+ googleChatProjectNumber?: string;
550
+ /** `service-{projectNumber}@gcp-sa-gsuiteaddons.iam.gserviceaccount.com`, for an app built as a Workspace add-on. */
551
+ workspaceAddOnServiceAccountEmail?: string;
552
+ userName?: string;
553
+ trace?: "enabled" | "disabled";
554
+ partition?: ChannelPartition;
555
+ [key: string]: unknown;
556
+ }
557
+ /**
558
+ * A Microsoft Teams bot registered in Azure Bot Service, authenticated with a
559
+ * client secret. `appTenantId` is required unless `appType` is `MultiTenant`.
560
+ */
561
+ interface AgentTeamsChannelConfig {
562
+ allowedChannelIds?: string[];
563
+ allowedUserIds?: string[];
564
+ id?: string;
565
+ apiUrl?: string;
566
+ appId?: string;
567
+ appPassword?: string;
568
+ appTenantId?: string;
569
+ appType?: "MultiTenant" | "SingleTenant";
570
+ userName?: string;
571
+ trace?: "enabled" | "disabled";
572
+ partition?: ChannelPartition;
573
+ [key: string]: unknown;
574
+ }
575
+ /**
576
+ * A Twilio number or Messaging Service for SMS and MMS. `authToken` checks
577
+ * Twilio's signature, which covers the exact public URL Twilio called, so
578
+ * `webhookUrl` is only set when that URL is not the broods webhook URL.
579
+ */
580
+ interface AgentTwilioChannelConfig {
581
+ allowedChannelIds?: string[];
582
+ allowedUserIds?: string[];
583
+ id?: string;
584
+ accountSid?: string;
585
+ apiUrl?: string;
586
+ authToken?: string;
587
+ /** `MG...`. Replies go through the service instead of the number texted. */
588
+ messagingServiceSid?: string;
589
+ /** E.164 number, e.g. `+15551234567`. Messages to another number go to the agent holding it. */
590
+ phoneNumber?: string;
591
+ statusCallbackUrl?: string;
592
+ userName?: string;
593
+ /** The URL entered in the Twilio console, when it is not `{PUBLIC_BASE_URL}/v1/webhooks/...`. */
594
+ webhookUrl?: string;
595
+ trace?: "enabled" | "disabled";
596
+ partition?: ChannelPartition;
597
+ [key: string]: unknown;
598
+ }
599
+ /**
600
+ * A WhatsApp Business Cloud API number. `appSecret` signs every delivery and
601
+ * `verifyToken` answers Meta's subscription handshake.
602
+ */
603
+ interface AgentWhatsAppChannelConfig {
604
+ allowedChannelIds?: string[];
605
+ allowedUserIds?: string[];
606
+ id?: string;
607
+ accessToken?: string;
608
+ apiUrl?: string;
609
+ apiVersion?: string;
610
+ appSecret?: string;
611
+ phoneNumberId?: string;
612
+ userName?: string;
613
+ verifyToken?: string;
614
+ trace?: "enabled" | "disabled";
615
+ partition?: ChannelPartition;
616
+ [key: string]: unknown;
617
+ }
480
618
 
481
619
  /**
482
620
  * Cron-job records and patch-merge helpers for the runtime. Input
@@ -674,6 +812,22 @@ interface TelegramSource {
674
812
  fromUsername?: string;
675
813
  }
676
814
 
815
+ /**
816
+ * Google Chat channel adapter, for a Chat app on an HTTP endpoint. The Chat
817
+ * SDK adapter is the transport: it verifies Google's signed token, reads the
818
+ * message and posts the reply as the app's service account. Pub/Sub delivery
819
+ * is not wired, so the app hears direct messages and @-mentions only.
820
+ */
821
+
822
+ interface GoogleChatSource {
823
+ messageName: string;
824
+ spaceName: string;
825
+ threadId: string;
826
+ threadName?: string;
827
+ userId?: string;
828
+ userName?: string;
829
+ }
830
+
677
831
  /**
678
832
  * GitHub channel adapter. Event filtering and source mapping live here; auth and
679
833
  * API calls go through the Chat SDK.
@@ -763,6 +917,64 @@ interface PancakeSource {
763
917
  tagIds?: string[];
764
918
  }
765
919
 
920
+ /**
921
+ * Microsoft Teams channel adapter, on the Bot Framework. The Chat SDK adapter
922
+ * is the transport that reads the activity and posts the reply; the inbound
923
+ * token is checked with the Teams SDK's JWT validator, set up for Bot Framework
924
+ * connector tokens only, since the Chat SDK only reaches it through a full
925
+ * `Chat` instance.
926
+ */
927
+
928
+ interface TeamsSource {
929
+ conversationId: string;
930
+ messageId: string;
931
+ threadId: string;
932
+ userId?: string;
933
+ userName?: string;
934
+ }
935
+
936
+ /**
937
+ * The core HTTP contract every handler speaks, plus generic request/response
938
+ * helpers. Handlers take a CoreRequest + RequestContext and return a Web
939
+ * Response; the transport edge (`src/server.ts`) builds the CoreRequest from
940
+ * a real request. Keep route-specific logic out of here.
941
+ */
942
+ declare global {
943
+ interface BunFetchRequestInit {
944
+ timeout?: number | boolean;
945
+ }
946
+ }
947
+
948
+ /**
949
+ * Twilio channel adapter, for SMS and MMS on a Twilio number or Messaging
950
+ * Service. The Chat SDK adapter is the transport: it checks Twilio's
951
+ * signature, reads the form Twilio posts and sends the reply. SMS has no typing
952
+ * indicator and no reactions, so those actions do nothing.
953
+ */
954
+
955
+ interface TwilioSource {
956
+ /** The person's number, where the reply goes. */
957
+ from: string;
958
+ messageSid: string;
959
+ /** The Twilio number they texted. */
960
+ to: string;
961
+ }
962
+
963
+ /**
964
+ * WhatsApp channel adapter, on the WhatsApp Business Cloud API. The Chat SDK
965
+ * adapter is the transport: it checks Meta's signature, reads the message and
966
+ * posts the reply. Meta's GET subscription handshake is answered here too,
967
+ * because it arrives on the same webhook URL.
968
+ */
969
+
970
+ interface WhatsAppSource {
971
+ messageId: string;
972
+ phoneNumberId: string;
973
+ threadId: string;
974
+ userName?: string;
975
+ userWaId: string;
976
+ }
977
+
766
978
  /** Zalo channel adapter, on the official Zalo Bot API. */
767
979
 
768
980
  declare const ZALO_CHAT_TYPES: readonly ["PRIVATE", "GROUP"];
@@ -1241,7 +1453,7 @@ interface AgentReference<Name extends string = string> {
1241
1453
  }
1242
1454
  interface ChannelReference {
1243
1455
  readonly kind: "channel";
1244
- readonly type: "telegram" | "github" | "slack" | "discord" | "matrix" | "pancake" | "zalo";
1456
+ readonly type: "telegram" | "gchat" | "github" | "slack" | "discord" | "matrix" | "pancake" | "teams" | "twilio" | "zalo" | "whatsapp";
1245
1457
  readonly agentName: string;
1246
1458
  readonly agentId: string;
1247
1459
  readonly accountId: string;
@@ -2093,7 +2305,7 @@ interface McpDefinitionConfig {
2093
2305
  /** Tool names agents may use from this server; omit to allow all. */
2094
2306
  allowedTools?: string[];
2095
2307
  }
2096
- type ChannelType = "telegram" | "github" | "slack" | "discord" | "matrix" | "pancake" | "zalo";
2308
+ type ChannelType = "telegram" | "gchat" | "github" | "slack" | "discord" | "matrix" | "pancake" | "teams" | "twilio" | "zalo" | "whatsapp";
2097
2309
  /**
2098
2310
  * A connection is one app install: the credentials an agent needs before a
2099
2311
  * provider can reach it at all. Channels point at a connection; a connection
@@ -2132,28 +2344,36 @@ type ConnectionIdentityInput = {
2132
2344
  allowedUserIds?: readonly string[];
2133
2345
  };
2134
2346
  type TelegramConnectionInput = EnvRefString<RequiredChannelKeys<Pick<AgentTelegramChannelConfig, "apiUrl" | "botToken" | "webhookSecret" | "botUsername" | "reactionEmoji">, "botToken" | "webhookSecret">> & ConnectionIdentityInput;
2347
+ type GoogleChatConnectionInput = EnvRefString<RequiredChannelKeys<Pick<AgentGoogleChatChannelConfig, "credentials" | "endpointUrl" | "googleChatProjectNumber" | "userName" | "workspaceAddOnServiceAccountEmail">, "credentials">> & ConnectionIdentityInput;
2135
2348
  type GitHubConnectionInput = EnvRefString<RequiredChannelKeys<Pick<AgentGitHubChannelConfig, "apiUrl" | "webhookSecret" | "appId" | "privateKey" | "botUserName" | "botUserId" | "triggerOnIssueOpen" | "triggerOnPROpen">, "webhookSecret" | "appId" | "privateKey">> & ConnectionIdentityInput;
2136
2349
  type SlackConnectionInput = EnvRefString<RequiredChannelKeys<Pick<AgentSlackChannelConfig, "apiUrl" | "botToken" | "signingSecret" | "reactionEmoji">, "botToken" | "signingSecret">> & ConnectionIdentityInput;
2137
2350
  type DiscordConnectionInput = EnvRefString<RequiredChannelKeys<Pick<AgentDiscordChannelConfig, "apiUrl" | "botToken" | "publicKey" | "botUserId" | "mentionRoleIds">, "botToken" | "publicKey">> & ConnectionIdentityInput;
2138
2351
  type MatrixConnectionInput = EnvRefString<RequiredChannelKeys<Pick<AgentMatrixChannelConfig, "apiUrl" | "botToken" | "botName" | "mentionText">, "apiUrl" | "botToken">> & ConnectionIdentityInput;
2352
+ type TeamsConnectionInput = EnvRefString<RequiredChannelKeys<Pick<AgentTeamsChannelConfig, "apiUrl" | "appId" | "appPassword" | "appTenantId" | "appType" | "userName">, "appId" | "appPassword">> & ConnectionIdentityInput;
2353
+ type WhatsAppConnectionInput = EnvRefString<RequiredChannelKeys<Pick<AgentWhatsAppChannelConfig, "accessToken" | "apiUrl" | "apiVersion" | "appSecret" | "phoneNumberId" | "userName" | "verifyToken">, "accessToken" | "appSecret" | "phoneNumberId" | "verifyToken">> & ConnectionIdentityInput;
2139
2354
  interface PancakeConnectionInput extends ConnectionIdentityInput {
2140
2355
  pageId: ChannelSecret;
2141
2356
  pageAccessToken: ChannelSecret;
2142
2357
  webhookSecret: ChannelSecret;
2143
2358
  senderId?: string | EnvRef;
2144
2359
  }
2360
+ type TwilioConnectionInput = EnvRefString<RequiredChannelKeys<Pick<AgentTwilioChannelConfig, "accountSid" | "apiUrl" | "authToken" | "messagingServiceSid" | "phoneNumber" | "statusCallbackUrl" | "userName" | "webhookUrl">, "accountSid" | "authToken">> & ConnectionIdentityInput;
2145
2361
  interface ZaloConnectionInput extends ConnectionIdentityInput {
2146
2362
  botToken: ChannelSecret;
2147
2363
  webhookSecret: ChannelSecret;
2148
2364
  }
2149
2365
  type TelegramConnectionDefinition = ConnectionDefinition<"telegram", TelegramConnectionInput>;
2366
+ type GoogleChatConnectionDefinition = ConnectionDefinition<"gchat", GoogleChatConnectionInput>;
2150
2367
  type GitHubConnectionDefinition = ConnectionDefinition<"github", GitHubConnectionInput>;
2151
2368
  type SlackConnectionDefinition = ConnectionDefinition<"slack", SlackConnectionInput>;
2152
2369
  type DiscordConnectionDefinition = ConnectionDefinition<"discord", DiscordConnectionInput>;
2153
2370
  type MatrixConnectionDefinition = ConnectionDefinition<"matrix", MatrixConnectionInput>;
2154
2371
  type PancakeConnectionDefinition = ConnectionDefinition<"pancake", PancakeConnectionInput>;
2372
+ type TeamsConnectionDefinition = ConnectionDefinition<"teams", TeamsConnectionInput>;
2373
+ type TwilioConnectionDefinition = ConnectionDefinition<"twilio", TwilioConnectionInput>;
2155
2374
  type ZaloConnectionDefinition = ConnectionDefinition<"zalo", ZaloConnectionInput>;
2156
- type AnyConnectionDefinition = TelegramConnectionDefinition | GitHubConnectionDefinition | SlackConnectionDefinition | DiscordConnectionDefinition | MatrixConnectionDefinition | PancakeConnectionDefinition | ZaloConnectionDefinition;
2375
+ type WhatsAppConnectionDefinition = ConnectionDefinition<"whatsapp", WhatsAppConnectionInput>;
2376
+ type AnyConnectionDefinition = TelegramConnectionDefinition | GoogleChatConnectionDefinition | GitHubConnectionDefinition | SlackConnectionDefinition | DiscordConnectionDefinition | MatrixConnectionDefinition | PancakeConnectionDefinition | TeamsConnectionDefinition | TwilioConnectionDefinition | ZaloConnectionDefinition | WhatsAppConnectionDefinition;
2157
2377
  /**
2158
2378
  * One real place a team talks: a Slack channel, a Discord channel, a repo. It
2159
2379
  * narrows and adds, and never grants what a bound agent lacks: instructions
@@ -2210,21 +2430,43 @@ type MatrixChannelInput = ChannelRulesInput & {
2210
2430
  /** Matrix room id, e.g. "!abc123:matrix.org". */
2211
2431
  channelId: string;
2212
2432
  };
2433
+ type GoogleChatChannelInput = ChannelRulesInput & {
2434
+ connection: GoogleChatConnectionDefinition;
2435
+ /** Google Chat space name, e.g. "spaces/AAAAxxxx". */
2436
+ spaceName: string;
2437
+ };
2213
2438
  type GitHubChannelInput = ChannelRulesInput & {
2214
2439
  connection: GitHubConnectionDefinition;
2215
2440
  /** Repository full name, e.g. "beeblast/api". */
2216
2441
  repo: string;
2217
2442
  };
2443
+ type TeamsChannelInput = ChannelRulesInput & {
2444
+ connection: TeamsConnectionDefinition;
2445
+ /** Teams channel id, or a chat's conversation id, e.g. "19:abc@thread.tacv2". */
2446
+ channelId: string;
2447
+ /** Team the channel sits in. */
2448
+ teamId?: string;
2449
+ };
2218
2450
  type TelegramChannelInput = ChannelRulesInput & {
2219
2451
  connection: TelegramConnectionDefinition;
2220
2452
  /** Telegram chat id, e.g. "-1001234567". */
2221
2453
  chatId: string;
2222
2454
  };
2455
+ type TwilioChannelInput = ChannelRulesInput & {
2456
+ connection: TwilioConnectionDefinition;
2457
+ /** Sender's number in E.164, e.g. "+15551234567", or several. */
2458
+ from: string | readonly string[];
2459
+ };
2223
2460
  type ZaloChannelInput = ChannelRulesInput & {
2224
2461
  connection: ZaloConnectionDefinition;
2225
2462
  /** Zalo user or group chat id, or several that share one set of rules. */
2226
2463
  chatId: string | readonly string[];
2227
2464
  };
2465
+ type WhatsAppChannelInput = ChannelRulesInput & {
2466
+ connection: WhatsAppConnectionDefinition;
2467
+ /** Customer's WhatsApp id, their number with country code and no "+", or several. */
2468
+ waId: string | readonly string[];
2469
+ };
2228
2470
  type PancakeChannelInput = ChannelRulesInput & {
2229
2471
  connection: PancakeConnectionDefinition;
2230
2472
  /** Pancake conversation id. */
@@ -2254,7 +2496,8 @@ type AgentSkillsDefinitionConfig = Omit<NonNullable<AgentConfig["skills"]>, "all
2254
2496
  };
2255
2497
  interface HookContext {
2256
2498
  fetch: typeof fetch;
2257
- config: Record<string, unknown>;
2499
+ /** The model and the names of the agent's tools, MCP servers, channels, skills and subagents. Never credentials. */
2500
+ config: HookAgentConfig;
2258
2501
  /**
2259
2502
  * Mutable per-request scratchpad shared across this agent request's hooks.
2260
2503
  * Seed it in an early hook (e.g. `onStart`) and read or modify it later.
@@ -2272,12 +2515,16 @@ type Handler<Event, Result> = (ctx: HookContext, event: Event) => Result | void
2272
2515
  * Pancake `tagIds`).
2273
2516
  */
2274
2517
  type TelegramMessageSource = TelegramSource;
2518
+ type GoogleChatMessageSource = GoogleChatSource;
2275
2519
  type GitHubMessageSource = GitHubSource;
2276
2520
  type SlackMessageSource = SlackSource;
2277
2521
  type DiscordMessageSource = DiscordSource;
2278
2522
  type MatrixMessageSource = MatrixSource;
2279
2523
  type PancakeMessageSource = PancakeSource;
2524
+ type TeamsMessageSource = TeamsSource;
2525
+ type TwilioMessageSource = TwilioSource;
2280
2526
  type ZaloMessageSource = ZaloSource;
2527
+ type WhatsAppMessageSource = WhatsAppSource;
2281
2528
  /**
2282
2529
  * Inbound channel message passed to `onMessageReceived`, discriminated on
2283
2530
  * `channel` so each variant exposes its channel's strongly-typed `source`.
@@ -2286,6 +2533,10 @@ type ChannelMessageReceived = {
2286
2533
  channel: "telegram";
2287
2534
  text: string;
2288
2535
  source: TelegramMessageSource;
2536
+ } | {
2537
+ channel: "gchat";
2538
+ text: string;
2539
+ source: GoogleChatMessageSource;
2289
2540
  } | {
2290
2541
  channel: "github";
2291
2542
  text: string;
@@ -2306,10 +2557,22 @@ type ChannelMessageReceived = {
2306
2557
  channel: "pancake";
2307
2558
  text: string;
2308
2559
  source: PancakeMessageSource;
2560
+ } | {
2561
+ channel: "teams";
2562
+ text: string;
2563
+ source: TeamsMessageSource;
2564
+ } | {
2565
+ channel: "twilio";
2566
+ text: string;
2567
+ source: TwilioMessageSource;
2309
2568
  } | {
2310
2569
  channel: "zalo";
2311
2570
  text: string;
2312
2571
  source: ZaloMessageSource;
2572
+ } | {
2573
+ channel: "whatsapp";
2574
+ text: string;
2575
+ source: WhatsAppMessageSource;
2313
2576
  };
2314
2577
  /**
2315
2578
  * Inline agent hook callbacks. Handlers are serialized with `.toString()`,
@@ -2494,21 +2757,29 @@ declare function defineSkill<const Name extends string>(input: ResourceInput<Nam
2494
2757
  declare function defineWorkspace<const Name extends string>(input: ResourceInput<Name, WorkspaceDefinitionConfig>): WorkspaceResource<Name>;
2495
2758
  declare function defineDiscordConnection(config: DiscordConnectionInput): DiscordConnectionDefinition;
2496
2759
  declare function defineGitHubConnection(config: GitHubConnectionInput): GitHubConnectionDefinition;
2760
+ declare function defineGoogleChatConnection(config: GoogleChatConnectionInput): GoogleChatConnectionDefinition;
2497
2761
  declare function defineMatrixConnection(config: MatrixConnectionInput): MatrixConnectionDefinition;
2498
2762
  declare function definePancakeConnection(config: PancakeConnectionInput): PancakeConnectionDefinition;
2499
2763
  declare function defineSlackConnection(config: SlackConnectionInput): SlackConnectionDefinition;
2764
+ declare function defineTeamsConnection(config: TeamsConnectionInput): TeamsConnectionDefinition;
2500
2765
  declare function defineTelegramConnection(config: TelegramConnectionInput): TelegramConnectionDefinition;
2766
+ declare function defineTwilioConnection(config: TwilioConnectionInput): TwilioConnectionDefinition;
2767
+ declare function defineWhatsAppConnection(config: WhatsAppConnectionInput): WhatsAppConnectionDefinition;
2501
2768
  declare function defineZaloConnection(config: ZaloConnectionInput): ZaloConnectionDefinition;
2502
2769
  declare function defineDiscordChannel<const Name extends string>(input: ResourceInput<Name, DiscordChannelInput>): ChannelResource<Name>;
2503
2770
  declare function defineGitHubChannel<const Name extends string>(input: ResourceInput<Name, GitHubChannelInput>): ChannelResource<Name>;
2771
+ declare function defineGoogleChatChannel<const Name extends string>(input: ResourceInput<Name, GoogleChatChannelInput>): ChannelResource<Name>;
2504
2772
  declare function defineMatrixChannel<const Name extends string>(input: ResourceInput<Name, MatrixChannelInput>): ChannelResource<Name>;
2505
2773
  declare function definePancakeChannel<const Name extends string>(input: ResourceInput<Name, PancakeChannelInput>): ChannelResource<Name>;
2506
2774
  declare function defineSlackChannel<const Name extends string>(input: ResourceInput<Name, SlackChannelInput>): ChannelResource<Name>;
2775
+ declare function defineTeamsChannel<const Name extends string>(input: ResourceInput<Name, TeamsChannelInput>): ChannelResource<Name>;
2507
2776
  declare function defineTelegramChannel<const Name extends string>(input: ResourceInput<Name, TelegramChannelInput>): ChannelResource<Name>;
2777
+ declare function defineTwilioChannel<const Name extends string>(input: ResourceInput<Name, TwilioChannelInput>): ChannelResource<Name>;
2778
+ declare function defineWhatsAppChannel<const Name extends string>(input: ResourceInput<Name, WhatsAppChannelInput>): ChannelResource<Name>;
2508
2779
  declare function defineZaloChannel<const Name extends string>(input: ResourceInput<Name, ZaloChannelInput>): ChannelResource<Name>;
2509
2780
  declare function isBroodsConfig(value: unknown): value is BroodsConfigDefinition;
2510
2781
  declare function isConnectionDefinition(value: unknown): value is AnyConnectionDefinition;
2511
2782
  declare function isResource(value: unknown): value is AnyResource;
2512
2783
 
2513
- export { BroodsAccountApiError, BroodsAccountClient, BroodsClient, BroodsWebSocketClient, DEFAULT_CORE_BASE_URL, IngressAcceptedError, MAX_OBSERVABILITY_BACKFILL, BroodsWebSocketClient as WebSocketClient, BroodsWebSocketClient as WebsocketClient, defineAgent, defineBroods, defineCron, defineDiscordChannel, defineDiscordConnection, defineGitHubChannel, defineGitHubConnection, defineHarness, defineMatrixChannel, defineMatrixConnection, defineMcp, definePancakeChannel, definePancakeConnection, definePolicy, defineSandbox, defineSkill, defineSlackChannel, defineSlackConnection, defineTelegramChannel, defineTelegramConnection, defineWorkspace, defineZaloChannel, defineZaloConnection, env, envPlaceholder, isBroodsConfig, isConnectionDefinition, isLogLevel, isObservabilityClientMessage, isResource, isRootSpanKind, isSandboxLogId, isTraceId, normalizeHttpServiceUrl, readSseStream, resolveEnvCredential, resolveRunEvents, toWebSocketBaseUrl, webSocketSubprotocols };
2514
- export type { Account, AccountAgent, AccountChannel, AccountEnvVar, AccountMcp, AccountPolicy, AccountRole, AccountSandbox, AccountWorkspace, Agent, AgentChannelsConfig, AgentCodeHookConfig, AgentConfig, AgentConfigDoc, AgentContinueInput, AgentDefinitionConfig, AgentDiscordChannelConfig, AgentGitHubChannelConfig, AgentHandle, AgentHookEventName, AgentHooks, AgentHooksConfig, AgentMatrixChannelConfig, AgentPancakeChannelConfig, AgentProviderSettings, AgentReference, AgentResource, AgentRunAnswerInput, AgentRunEventInput, AgentRunInput, AgentRunModelOverrides, AgentRunOverrides, AgentRunResult, AgentSkillsDefinitionConfig, AgentSlackChannelConfig, AgentStreamPart, AgentSubagentDefinitionConfig, AgentTelegramChannelConfig, AgentWebhookHookConfig, AgentWorkspaceInput, AgentWorkspaceRef, AgentWorkspaceRefInput, AgentZaloChannelConfig, AnyConnectionDefinition, AnyResource, AssumeRoleResult, AsyncAgentRun, AsyncPollOptions, AsyncRequestAccepted, AsyncStatus, BroodsAccount, BroodsAccountClientOptions, BroodsClientOptions, BroodsConfigDefinition, BroodsProjectConfig, BroodsWebSocketClientOptions, ChannelAgentInput, ChannelDefinitionConfig, ChannelMessageReceived, ChannelPartition, ChannelRecordConfig, ChannelReference, ChannelReplyIn, ChannelResource, ChannelType, CliManifest, CliManifestResource, ConfigPatch, ConnectionDefinition, CreateAgentResult, CreateCronInput, CreateMcpInput, Cron, CronDefinitionConfig, CronDoc, CronLastStatus, CronResource, CronRun, CronStatus, DeleteAccountResult, DiscordChannelInput, DiscordConnectionDefinition, DiscordConnectionInput, DiscordMessageSource, DiscordSource, Doc, EnvAccessor, EnvRef, EnvRefString, GeneratedIds, GitHubChannelInput, GitHubConnectionDefinition, GitHubConnectionInput, GitHubMessageSource, GitHubSource, HarnessDefinition, HarnessType, HookContext, Id, IngressMode, IngressStatus, LogLevel, MatrixChannelInput, MatrixConnectionDefinition, MatrixConnectionInput, MatrixMessageSource, MatrixSource, McpDefinitionConfig, McpHandler, McpOauthInput, McpResource, ObservabilityBackfillMessage, ObservabilityClientMessage, ObservabilityErrorMessage, ObservabilityFetchTraceMessage, ObservabilityLogEntry, ObservabilityLogMessage, ObservabilityReadyMessage, ObservabilityServerMessage, ObservabilitySpanMessage, ObservabilitySpanRow, ObservabilitySubscribeMessage, ObservabilityUnsubscribeMessage, PancakeChannelInput, PancakeConnectionDefinition, PancakeConnectionInput, PancakeMessageSource, PancakeSource, PendingQuestion, PolicyDefinitionConfig, PolicyDocument, PolicyResource, ProjectDoc, ProviderConfigInput, ProviderSettingsInput, QuestionAnswer, ResourceApi, ResourceDefinition, ResourceInput, ResourceKind, RotateSecretResult, Sandbox, SandboxConfig, SandboxConfigDoc, SandboxDefinitionConfig, SandboxDefinitionOptions, SandboxLifecycleResult, SandboxResource, SandboxSnapshotResult, SandboxTerminalTicket, Skill, SkillDefinitionConfig, SkillResource, SkillUploadInput, SlackChannelInput, SlackConnectionDefinition, SlackConnectionInput, SlackMessageSource, SlackSource, StageDoc, StageScope, TaskWaitingOn, TelegramChannelInput, TelegramConnectionDefinition, TelegramConnectionInput, TelegramMessageSource, TelegramSource, ToolApprovalSummary, UpdateAgentInput, UpdateCronInput, UpdateMcpInput, WebSocketAttachInput, WebSocketClientAttachMessage, WebSocketClientCancelMessage, WebSocketClientControlMessage, WebSocketClientExecuteMessage, WebSocketClientMessage, WebSocketConstructorLike, WebSocketHandlers, WebSocketLike, WebSocketOutputMessage, WebSocketRunInput, WebSocketServerMessage, WebSocketStreamMessage, WebSocketSubscription, Workspace, WorkspaceConfig, WorkspaceConfigDoc, WorkspaceDefinitionConfig, WorkspaceFileEntry, WorkspaceResource, ZaloChannelInput, ZaloConnectionDefinition, ZaloConnectionInput, ZaloMessageSource, ZaloSource };
2784
+ export { BroodsAccountApiError, BroodsAccountClient, BroodsClient, BroodsWebSocketClient, DEFAULT_CORE_BASE_URL, IngressAcceptedError, MAX_OBSERVABILITY_BACKFILL, BroodsWebSocketClient as WebSocketClient, BroodsWebSocketClient as WebsocketClient, defineAgent, defineBroods, defineCron, defineDiscordChannel, defineDiscordConnection, defineGitHubChannel, defineGitHubConnection, defineGoogleChatChannel, defineGoogleChatConnection, defineHarness, defineMatrixChannel, defineMatrixConnection, defineMcp, definePancakeChannel, definePancakeConnection, definePolicy, defineSandbox, defineSkill, defineSlackChannel, defineSlackConnection, defineTeamsChannel, defineTeamsConnection, defineTelegramChannel, defineTelegramConnection, defineTwilioChannel, defineTwilioConnection, defineWhatsAppChannel, defineWhatsAppConnection, defineWorkspace, defineZaloChannel, defineZaloConnection, env, envPlaceholder, isBroodsConfig, isConnectionDefinition, isLogLevel, isObservabilityClientMessage, isResource, isRootSpanKind, isSandboxLogId, isTraceId, normalizeHttpServiceUrl, readSseStream, resolveEnvCredential, resolveRunEvents, toWebSocketBaseUrl, webSocketSubprotocols };
2785
+ export type { Account, AccountAgent, AccountChannel, AccountEnvVar, AccountMcp, AccountPolicy, AccountRole, AccountSandbox, AccountWorkspace, Agent, AgentChannelsConfig, AgentCodeHookConfig, AgentConfig, AgentConfigDoc, AgentContinueInput, AgentDefinitionConfig, AgentDiscordChannelConfig, AgentGitHubChannelConfig, AgentGoogleChatChannelConfig, AgentHandle, AgentHookEventName, AgentHooks, AgentHooksConfig, AgentMatrixChannelConfig, AgentPancakeChannelConfig, AgentProviderSettings, AgentReference, AgentResource, AgentRunAnswerInput, AgentRunEventInput, AgentRunInput, AgentRunModelOverrides, AgentRunOverrides, AgentRunResult, AgentSkillsDefinitionConfig, AgentSlackChannelConfig, AgentStreamPart, AgentSubagentDefinitionConfig, AgentTeamsChannelConfig, AgentTelegramChannelConfig, AgentTwilioChannelConfig, AgentWebhookHookConfig, AgentWhatsAppChannelConfig, AgentWorkspaceInput, AgentWorkspaceRef, AgentWorkspaceRefInput, AgentZaloChannelConfig, AnyConnectionDefinition, AnyResource, AssumeRoleResult, AsyncAgentRun, AsyncPollOptions, AsyncRequestAccepted, AsyncStatus, BroodsAccount, BroodsAccountClientOptions, BroodsClientOptions, BroodsConfigDefinition, BroodsProjectConfig, BroodsWebSocketClientOptions, ChannelAgentInput, ChannelDefinitionConfig, ChannelMessageReceived, ChannelPartition, ChannelRecordConfig, ChannelReference, ChannelReplyIn, ChannelResource, ChannelType, CliManifest, CliManifestResource, ConfigPatch, ConnectionDefinition, CreateAgentResult, CreateCronInput, CreateMcpInput, Cron, CronDefinitionConfig, CronDoc, CronLastStatus, CronResource, CronRun, CronStatus, DeleteAccountResult, DiscordChannelInput, DiscordConnectionDefinition, DiscordConnectionInput, DiscordMessageSource, DiscordSource, Doc, EnvAccessor, EnvRef, EnvRefString, GeneratedIds, GitHubChannelInput, GitHubConnectionDefinition, GitHubConnectionInput, GitHubMessageSource, GitHubSource, GoogleChatChannelInput, GoogleChatConnectionDefinition, GoogleChatConnectionInput, GoogleChatMessageSource, GoogleChatSource, HarnessDefinition, HarnessType, HookAgentConfig, HookContext, Id, IngressMode, IngressStatus, LogLevel, MatrixChannelInput, MatrixConnectionDefinition, MatrixConnectionInput, MatrixMessageSource, MatrixSource, McpDefinitionConfig, McpHandler, McpOauthInput, McpResource, ObservabilityBackfillMessage, ObservabilityClientMessage, ObservabilityErrorMessage, ObservabilityFetchTraceMessage, ObservabilityLogEntry, ObservabilityLogMessage, ObservabilityReadyMessage, ObservabilityServerMessage, ObservabilitySpanMessage, ObservabilitySpanRow, ObservabilitySubscribeMessage, ObservabilityUnsubscribeMessage, PancakeChannelInput, PancakeConnectionDefinition, PancakeConnectionInput, PancakeMessageSource, PancakeSource, PendingQuestion, PolicyDefinitionConfig, PolicyDocument, PolicyResource, ProjectDoc, ProviderConfigInput, ProviderSettingsInput, QuestionAnswer, ResourceApi, ResourceDefinition, ResourceInput, ResourceKind, RotateSecretResult, Sandbox, SandboxConfig, SandboxConfigDoc, SandboxDefinitionConfig, SandboxDefinitionOptions, SandboxLifecycleResult, SandboxResource, SandboxSnapshotResult, SandboxTerminalTicket, Skill, SkillDefinitionConfig, SkillResource, SkillUploadInput, SlackChannelInput, SlackConnectionDefinition, SlackConnectionInput, SlackMessageSource, SlackSource, StageDoc, StageScope, TaskWaitingOn, TeamsChannelInput, TeamsConnectionDefinition, TeamsConnectionInput, TeamsMessageSource, TeamsSource, TelegramChannelInput, TelegramConnectionDefinition, TelegramConnectionInput, TelegramMessageSource, TelegramSource, ToolApprovalSummary, TwilioChannelInput, TwilioConnectionDefinition, TwilioConnectionInput, TwilioMessageSource, TwilioSource, UpdateAgentInput, UpdateCronInput, UpdateMcpInput, WebSocketAttachInput, WebSocketClientAttachMessage, WebSocketClientCancelMessage, WebSocketClientControlMessage, WebSocketClientExecuteMessage, WebSocketClientMessage, WebSocketConstructorLike, WebSocketHandlers, WebSocketLike, WebSocketOutputMessage, WebSocketRunInput, WebSocketServerMessage, WebSocketStreamMessage, WebSocketSubscription, WhatsAppChannelInput, WhatsAppConnectionDefinition, WhatsAppConnectionInput, WhatsAppMessageSource, WhatsAppSource, Workspace, WorkspaceConfig, WorkspaceConfigDoc, WorkspaceDefinitionConfig, WorkspaceFileEntry, WorkspaceResource, ZaloChannelInput, ZaloConnectionDefinition, ZaloConnectionInput, ZaloMessageSource, ZaloSource };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{V,ge,Me,Te,Ne,je,G,Ie,E,ye,U,J,xe,Y,C,qe,De,Le,Ue,Fe,Be,Ze,He,Ve,Ge,Ke,We,Je,Ye,Xe,Qe,et,tt,nt,rt,ot,st,it,at,ie,w,g}from"./chunk-n50ycxj1.js";import{m,Oe,B,Z}from"./chunk-a09r7men.js";export{m as BroodsAccountApiError,Z as BroodsAccountClient,U as BroodsClient,xe as BroodsWebSocketClient,E as DEFAULT_CORE_BASE_URL,ye as IngressAcceptedError,Me as MAX_OBSERVABILITY_BACKFILL,xe as WebSocketClient,xe as WebsocketClient,De as defineAgent,Le as defineBroods,Ue as defineCron,tt as defineDiscordChannel,Ke as defineDiscordConnection,nt as defineGitHubChannel,We as defineGitHubConnection,Fe as defineHarness,rt as defineMatrixChannel,Je as defineMatrixConnection,Be as defineMcp,ot as definePancakeChannel,Ye as definePancakeConnection,Ze as definePolicy,He as defineSandbox,Ve as defineSkill,st as defineSlackChannel,Xe as defineSlackConnection,it as defineTelegramChannel,Qe as defineTelegramConnection,Ge as defineWorkspace,at as defineZaloChannel,et as defineZaloConnection,qe as env,Oe as envPlaceholder,ie as isBroodsConfig,w as isConnectionDefinition,Te as isLogLevel,Ne as isObservabilityClientMessage,g as isResource,je as isRootSpanKind,G as isSandboxLogId,Ie as isTraceId,J as normalizeHttpServiceUrl,ge as readSseStream,B as resolveEnvCredential,V as resolveRunEvents,Y as toWebSocketBaseUrl,C as webSocketSubprotocols};
1
+ import{V,ge,Me,Pe,Ne,je,G,Ie,C,ye,U,J,xe,Y,E,qe,De,Le,Ue,Fe,Be,Ze,He,Ve,Ge,We,Ke,Je,Ye,Xe,Qe,et,tt,nt,rt,ot,st,it,at,ct,lt,ut,dt,pt,mt,ht,ft,ie,w,g}from"./chunk-zbp92p62.js";import{m,Ae,B,Z}from"./chunk-p7t6yawg.js";export{m as BroodsAccountApiError,Z as BroodsAccountClient,U as BroodsClient,xe as BroodsWebSocketClient,C as DEFAULT_CORE_BASE_URL,ye as IngressAcceptedError,Me as MAX_OBSERVABILITY_BACKFILL,xe as WebSocketClient,xe as WebsocketClient,De as defineAgent,Le as defineBroods,Ue as defineCron,st as defineDiscordChannel,We as defineDiscordConnection,it as defineGitHubChannel,Ke as defineGitHubConnection,at as defineGoogleChatChannel,Je as defineGoogleChatConnection,Fe as defineHarness,ct as defineMatrixChannel,Ye as defineMatrixConnection,Be as defineMcp,lt as definePancakeChannel,Xe as definePancakeConnection,Ze as definePolicy,He as defineSandbox,Ve as defineSkill,ut as defineSlackChannel,Qe as defineSlackConnection,dt as defineTeamsChannel,et as defineTeamsConnection,pt as defineTelegramChannel,tt as defineTelegramConnection,mt as defineTwilioChannel,nt as defineTwilioConnection,ht as defineWhatsAppChannel,rt as defineWhatsAppConnection,Ge as defineWorkspace,ft as defineZaloChannel,ot as defineZaloConnection,qe as env,Ae as envPlaceholder,ie as isBroodsConfig,w as isConnectionDefinition,Pe as isLogLevel,Ne as isObservabilityClientMessage,g as isResource,je as isRootSpanKind,G as isSandboxLogId,Ie as isTraceId,J as normalizeHttpServiceUrl,ge as readSseStream,B as resolveEnvCredential,V as resolveRunEvents,Y as toWebSocketBaseUrl,E as webSocketSubprotocols};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "broods",
3
- "version": "0.41.0",
3
+ "version": "0.42.0",
4
4
  "description": "CLI + TypeScript SDK for the broods agent platform.",
5
5
  "keywords": [
6
6
  "agents",