@codeam/shared 2.61.42 → 2.61.44

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.mts CHANGED
@@ -351,7 +351,7 @@ declare function isHeadroomWrappable(agentId: string): boolean;
351
351
  * ubiquitous CLI for the tool → `cliEnv`; otherwise → `mcp`. A tool may
352
352
  * declare both.
353
353
  */
354
- type IntegrationId = 'jira' | 'sentry' | 'linear' | 'slack' | 'notion' | 'azure_devops' | 'figma' | 'microsoft_teams' | 'google_chat' | 'discord' | 'github_issues' | 'github' | 'gitlab';
354
+ type IntegrationId = 'jira' | 'sentry' | 'linear' | 'slack' | 'notion' | 'azure_devops' | 'figma' | 'microsoft_teams' | 'google_chat' | 'discord' | 'resend' | 'github_issues' | 'github' | 'gitlab';
355
355
  /**
356
356
  * `derived` = no link flow of its own: the credential is BORROWED live from a
357
357
  * connection the user already made elsewhere (see `derivedFrom`). The backend
@@ -421,6 +421,12 @@ interface IntegrationDefinition {
421
421
  icon: string;
422
422
  category: IntegrationCategory;
423
423
  enabled: boolean;
424
+ /** A `comms` integration that only SENDS (e.g. Resend email) — it has no
425
+ * readable threads, so it is EXCLUDED from From-Conversation's source list
426
+ * (which needs `listRecentThreads`/`getThread`/`postReply`) while still being
427
+ * a linkable comms tool the agent uses via its MCP delivery. Absent/false for
428
+ * conversational comms (Slack, Discord). */
429
+ sendOnly?: boolean;
424
430
  auth: {
425
431
  kind: IntegrationAuthKind;
426
432
  scopes?: string[];
@@ -472,6 +478,12 @@ interface BrokeredIntegrationToken {
472
478
  * MCP server needs it alongside the PAT (`AZURE_DEVOPS_ORG_URL`). Absent for
473
479
  * non-ADO integrations. */
474
480
  orgUrl?: string;
481
+ /** Discord guild (server) id the app's bot was invited into for this user —
482
+ * the `mcp-discord` server scopes to it (`DISCORD_GUILD_ID`). ⚠️ Discord OAuth
483
+ * gives NO per-install token (unlike Slack): `accessToken` here is the app's
484
+ * single BOT token, injected by the broker from config — the per-user
485
+ * credential IS the guildId. Absent for non-Discord integrations. */
486
+ guildId?: string;
475
487
  }
476
488
 
477
489
  /**
@@ -519,7 +531,7 @@ interface IntegrationBranding {
519
531
  logoSvg: string;
520
532
  }
521
533
  declare const INTEGRATION_BRANDING: Record<string, IntegrationBranding>;
522
- declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "posthog", "clickup", "figma", "trello", "resend", "vercel", "supabase", "asana", "postman", "n8n", "stripe", "mixpanel", "pendo", "pagerduty", "amplitude", "datadog"];
534
+ declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "posthog", "clickup", "figma", "trello", "vercel", "supabase", "asana", "postman", "n8n", "stripe", "mixpanel", "pendo", "pagerduty", "amplitude", "datadog"];
523
535
  declare function getIntegrationBranding(id: string): IntegrationBranding | null;
524
536
 
525
537
  /**
package/dist/index.d.ts CHANGED
@@ -351,7 +351,7 @@ declare function isHeadroomWrappable(agentId: string): boolean;
351
351
  * ubiquitous CLI for the tool → `cliEnv`; otherwise → `mcp`. A tool may
352
352
  * declare both.
353
353
  */
354
- type IntegrationId = 'jira' | 'sentry' | 'linear' | 'slack' | 'notion' | 'azure_devops' | 'figma' | 'microsoft_teams' | 'google_chat' | 'discord' | 'github_issues' | 'github' | 'gitlab';
354
+ type IntegrationId = 'jira' | 'sentry' | 'linear' | 'slack' | 'notion' | 'azure_devops' | 'figma' | 'microsoft_teams' | 'google_chat' | 'discord' | 'resend' | 'github_issues' | 'github' | 'gitlab';
355
355
  /**
356
356
  * `derived` = no link flow of its own: the credential is BORROWED live from a
357
357
  * connection the user already made elsewhere (see `derivedFrom`). The backend
@@ -421,6 +421,12 @@ interface IntegrationDefinition {
421
421
  icon: string;
422
422
  category: IntegrationCategory;
423
423
  enabled: boolean;
424
+ /** A `comms` integration that only SENDS (e.g. Resend email) — it has no
425
+ * readable threads, so it is EXCLUDED from From-Conversation's source list
426
+ * (which needs `listRecentThreads`/`getThread`/`postReply`) while still being
427
+ * a linkable comms tool the agent uses via its MCP delivery. Absent/false for
428
+ * conversational comms (Slack, Discord). */
429
+ sendOnly?: boolean;
424
430
  auth: {
425
431
  kind: IntegrationAuthKind;
426
432
  scopes?: string[];
@@ -472,6 +478,12 @@ interface BrokeredIntegrationToken {
472
478
  * MCP server needs it alongside the PAT (`AZURE_DEVOPS_ORG_URL`). Absent for
473
479
  * non-ADO integrations. */
474
480
  orgUrl?: string;
481
+ /** Discord guild (server) id the app's bot was invited into for this user —
482
+ * the `mcp-discord` server scopes to it (`DISCORD_GUILD_ID`). ⚠️ Discord OAuth
483
+ * gives NO per-install token (unlike Slack): `accessToken` here is the app's
484
+ * single BOT token, injected by the broker from config — the per-user
485
+ * credential IS the guildId. Absent for non-Discord integrations. */
486
+ guildId?: string;
475
487
  }
476
488
 
477
489
  /**
@@ -519,7 +531,7 @@ interface IntegrationBranding {
519
531
  logoSvg: string;
520
532
  }
521
533
  declare const INTEGRATION_BRANDING: Record<string, IntegrationBranding>;
522
- declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "posthog", "clickup", "figma", "trello", "resend", "vercel", "supabase", "asana", "postman", "n8n", "stripe", "mixpanel", "pendo", "pagerduty", "amplitude", "datadog"];
534
+ declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "posthog", "clickup", "figma", "trello", "vercel", "supabase", "asana", "postman", "n8n", "stripe", "mixpanel", "pendo", "pagerduty", "amplitude", "datadog"];
523
535
  declare function getIntegrationBranding(id: string): IntegrationBranding | null;
524
536
 
525
537
  /**
package/dist/index.js CHANGED
@@ -835,12 +835,79 @@ var INTEGRATION_REGISTRY = {
835
835
  name: "Discord",
836
836
  icon: "discord",
837
837
  category: "comms",
838
- // COMING SOON placeholder catalog entry (no OAuth provider / MCP yet). The
839
- // agent will post review pings + read channels over the Discord API once the
840
- // provider lands. `enabled:false` dimmed "coming soon" tile.
841
- enabled: false,
842
- auth: { kind: "oauth_redirect" },
843
- delivery: {}
838
+ // LIVEthe DiscordOAuthProvider + DISCORD_* secrets (client id/secret,
839
+ // bot token, per-env redirect) are registered; the backend provider is
840
+ // config-gated (503 if env unset). Follows the SLACK pattern (OAuth redirect, zero friction),
841
+ // EXCEPT Discord OAuth gives no per-install token: the user's `bot`-scope
842
+ // authorize INVITES the app's single bot into their guild, and we store the
843
+ // returned guild id as the per-user credential. The broker injects the app's
844
+ // BOT token as `accessToken` (from config), so `DISCORD_TOKEN` = that bot
845
+ // token and `DISCORD_GUILD_ID` = the user's guild.
846
+ enabled: true,
847
+ auth: {
848
+ kind: "oauth_redirect",
849
+ // `bot` invites the app's bot into the user's guild (Guild Install);
850
+ // `guilds` lets the exchange read the guild name for display. The bot's
851
+ // channel permissions (View Channels + Read Message History + Send
852
+ // Messages + Send Messages in Threads) are set on the app's bot, NOT here.
853
+ // ⚠️ The app's bot MUST have the Message Content privileged intent enabled
854
+ // or read_messages returns empty content.
855
+ scopes: ["bot", "guilds"]
856
+ },
857
+ delivery: {
858
+ mcp: {
859
+ // mcp-discord (barryyip0625) — Node stdio, BYO bot token headless via the
860
+ // DISCORD_TOKEN env (never argv). Version PINNED; bump only after
861
+ // re-verifying headless. Tools: list/read channels + messages, send
862
+ // message, reply in thread, add reaction. `DISCORD_GUILD_ID` scopes it to
863
+ // the user's invited guild.
864
+ command: "npx",
865
+ args: ["-y", "mcp-discord@1.3.4"],
866
+ envMapping: {
867
+ DISCORD_TOKEN: "accessToken",
868
+ DISCORD_GUILD_ID: "guildId"
869
+ }
870
+ }
871
+ }
872
+ },
873
+ resend: {
874
+ id: "resend",
875
+ name: "Resend",
876
+ icon: "resend",
877
+ category: "comms",
878
+ // LIVE — api_key (like Azure DevOps): the user pastes a Resend API key
879
+ // (`re_…`); Resend has NO OAuth, so there's no OAuth app / GSM secret /
880
+ // config-gated 503 — a backend VALIDATOR proves the key against the Resend
881
+ // API and vaults it. ⚠️ SEND-ONLY email → `sendOnly: true` keeps it OUT of
882
+ // From-Conversation (comms conversation sources need readable threads; Resend
883
+ // has none) while still being a linkable comms tool the agent uses via MCP.
884
+ enabled: true,
885
+ sendOnly: true,
886
+ auth: {
887
+ kind: "api_key",
888
+ fields: [
889
+ {
890
+ key: "accessToken",
891
+ label: "API Key",
892
+ placeholder: "re_xxxxxxxxxxxxxxxx",
893
+ secret: true,
894
+ help: 'Create in Resend \u2192 API Keys (https://resend.com/api-keys). "Sending access" is enough.'
895
+ }
896
+ ]
897
+ },
898
+ delivery: {
899
+ mcp: {
900
+ // The OFFICIAL resend-mcp (Node) in BYO-token mode: the API key is fed
901
+ // via RESEND_API_KEY (env only, never argv). Version PINNED; bump only
902
+ // after re-verifying headless. Tools: send email + contacts/broadcasts/
903
+ // domains.
904
+ command: "npx",
905
+ args: ["-y", "resend-mcp@2.6.1"],
906
+ envMapping: {
907
+ RESEND_API_KEY: "accessToken"
908
+ }
909
+ }
910
+ }
844
911
  },
845
912
  notion: {
846
913
  id: "notion",
@@ -1250,7 +1317,6 @@ var UPCOMING_INTEGRATION_IDS = [
1250
1317
  "clickup",
1251
1318
  "figma",
1252
1319
  "trello",
1253
- "resend",
1254
1320
  "vercel",
1255
1321
  "supabase",
1256
1322
  "asana",