integrationPackage manifestv2.0.6

integration.provider-messaging

Messaging provider implementations for ContractSpec.

@lssm-tech/integration.provider-messaging
Source, release and verification context

Source snapshot bcc79fcc · Declared package version 2.0.6. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.

Package source ↗ Manifest ↗
servernode
EXPLORE THE PACKAGE

See where this package fits.

Follow a declared connection, inspect an import, then open the source guide when you need the detail.

THIS PACKAGEintegration.provider-messagingintegrations

Arrows point from a package to its direct dependency. Each count is derived from the captured manifests.

7 déclarations · les 6 premières affichéesSELECT TO INSPECT

@lssm-tech/integration.provider-messaging

Website: https://contractspec.io

Messaging provider implementations for ContractSpec.

Usage

Import the root entrypoint for the domain surface, or import a concrete implementation from the ./impls/* subpaths.

Included Providers

  • SlackMessagingProvider
  • GithubMessagingProvider
  • MatrixMessagingProvider
  • TelegramMessagingProvider
  • MetaWhatsappMessagingProvider
  • TwilioWhatsappMessagingProvider
  • createDiscordBotEcosystemAdapter
  • createTeamsGraphEcosystemAdapter
  • createTeamsBotEcosystemAdapter

Compatibility

This package owns the messaging implementation slice split out of @lssm-tech/integration.providers-impls. The legacy package continues to re-export these subpaths for existing consumers.

CommunicationOS OAuth

The ./wave-a-oauth-providers subpath exposes official Gmail, Microsoft Mail, Microsoft Teams, Slack, and Meta WhatsApp OAuth provider ports. Gmail, Microsoft, and PKCE-enabled Slack use authorization-code PKCE. Meta uses its Login for Business configuration and confidential client because its Embedded Signup surface does not advertise PKCE. Every flow keeps one-time state, resolves a stable provider account identity, writes only the flat credential shape consumed by the worker directly to an injected SecretProvider, and returns an opaque scope-bound credential reference. Meta authorization reports oauth_authorized until Embedded Signup also binds a WABA and phone-number ID; it does not claim messaging capability early. Telegram remains bot-secret based and does not pretend to offer an OAuth flow.

createMicrosoftMailOAuthProvider requests delegated Mail.Read and Mail.Send, resolves the signed-in mailbox through Graph /me, and writes the access token, refresh token, returned scopes, expiry, and sender address only to the scoped credential vault. Its provider key is microsoft; Gmail retains the google key and remains the default when both are configured. The connection also advertises subscription capability so a qualified CommunicationOS lifecycle worker can request Graph subscription create or renewal through Runtime Node authority. The OAuth callback does not perform that provider effect directly.

refreshMicrosoftDelegatedCredential refreshes only inside a bounded expiry window, requires the original client and refresh-token material from that same credential, rejects scope narrowing, and rotates through a caller-supplied exact-reference callback. Provider error bodies and tokens never become receipts, journal content, or fallback evidence.

Discord

createDiscordBotEcosystemAdapter provides the managed outbound Discord bot transport. It pins REST API v10, authenticates with a bot token, checks the bot identity through /users/@me, sends to channel or thread snowflake IDs, and derives Discord's bounded nonce from the durable idempotency key with enforce_nonce enabled. Ambient mentions are disabled unless a future governed policy explicitly enables them.

Transport failures, 5xx responses, and malformed 2xx responses are classified as indeterminate and require reconciliation rather than automatic retry or fallback. Rate limits retain the provider retry delay. The adapter does not claim guild installation, Gateway ingestion, interaction callbacks, privileged intents, history sync, attachments, reactions, editing, deletion, or read receipts.

Inbound and multi-guild observation live in the dedicated @lssm-tech/integration.communication-channel-discord package. This package retains the outbound adapter and compatibility export only; consumers must not infer inbound support from the generic synthetic adapter profile.

The dependency validator recognizes exactly this messaging-to-Discord edge as an existing compatibility facade. It is not a provider foundation or a general channel exemption: the target must remain a provider-free leaf, with no internal dependencies outside @lssm-tech/lib.*. Missing targets, other providers/channels, runtime back-edges, and all integration cycles still fail qualification. New observation consumers should import the channel package directly.

Store the bot token behind an opaque scoped secret reference. Guild-installed apps still require an authorized Discord installation with the bot scope and least-privilege channel permissions before this adapter can send.

Microsoft Teams

createTeamsGraphEcosystemAdapter is the canonical outbound Microsoft Graph adapter for a user-authorized Teams connection. It accepts only a non-expired delegated credential containing User.Read and ChannelMessage.Send, sends a plain-text message to an explicit team and channel, and classifies network, server, and malformed-success outcomes as indeterminate until reconciliation. It never treats Teamwork.Migrate.All or a client-credentials token as ordinary messaging authority.

createTeamsOAuthProvider performs authorization-code PKCE against Microsoft identity, verifies the signed-in account through /me, and writes the access token, refresh token, exact returned scopes, and expiry directly to the scoped credential vault. The current managed worker refuses expired tokens; automatic refresh and live ambiguous-result reconciliation remain separate qualification gates.

Microsoft Graph channel send is an on-behalf-of-user route. Autonomous Teams app notifications require an installed Teams bot/app and persisted conversation reference. createTeamsBotEcosystemAdapter provides that distinct proactive transport: it acquires a Bot Connector service token, accepts only Microsoft Teams service URLs, requires evidence that the conversation reference was captured from an authorized installation, and sends a message activity to that conversation. Token failures occur before the message effect; transport, 5xx, and malformed-success outcomes after token acquisition remain indeterminate. Blocked or uninstalled bots are definitive failures and do not silently fall back.

When Microsoft returns a safe diagnostic correlation header on an ambiguous Graph or Bot Connector response, the typed provider error retains only an opaque teams:*request:* evidence ref. It never retains response bodies, authorization data, or arbitrary headers. A diagnostic ref improves custody and operator escalation, but does not itself prove acceptance or failure.

createTeamsBotInboundAdapter and createTeamsBotConnectorJwtVerifier provide the matching admission path. The verifier accepts only bearer JWTs signed by an endorsed Bot Connector key, pins the published issuer, audience, RS256 algorithm, Microsoft metadata and key endpoints, applies the documented lifetime tolerance, and requires the signed serviceUrl to equal the activity value. CommunicationOS additionally requires its scoped endpoint token before this provider authentication runs.

Authenticated activities durably record a tenant- and connection-scoped conversation reference with its authentication evidence. Signed installationUpdate/remove activities revoke that reference, and active resolution refuses revoked references. The managed delivery context strips caller-supplied Bot Connector addressing and rehydrates serviceUrl and evidence only from that active journal projection before adapter health or send. Single-tenant profiles also bind the activity tenant to the configured tenant. Live app installation, Runtime Node effect execution, and ambiguous-send reconciliation remain qualification gates. No adapter accepts a user Graph token as a bot credential or a Bot Framework app secret as delegated-user authority.

Slack

SlackMessagingProvider implements Slack message send/update/delete plus conversations, users, reactions, files, and search operations over the Slack Web API. It requires a bot token for standard Web API calls and can optionally use a user token for search endpoints that require user-scoped Slack permissions.

Import it from:

ts
import { SlackMessagingProvider } from "@lssm-tech/integration.provider-messaging/impls/messaging-slack";
ts
const slack = new SlackMessagingProvider({
	botToken: process.env.SLACK_BOT_TOKEN!,
	userToken: process.env.SLACK_USER_TOKEN,
	defaultChannelId: "C0123456789",
});

await slack.sendMessage({ text: "ContractSpec check passed" });
const search = await slack.searchMessages("ContractSpec", 10);

For inbound Slack Event API requests, verify signatures and normalize events through @lssm-tech/integration.runtime/channel/slack or the higher-level Slack webhook receiver in @lssm-tech/integration.runtime/webhooks/slack. Keep botToken, userToken, app tokens, and signing secrets in a SecretProvider or environment secret store; never commit real Slack credentials, raw webhook URLs, or signed payload logs.

GitHub

GithubMessagingProvider implements the messaging bridge for GitHub issue and pull request comments. Use recipientId in the owner/repo#number form, or configure defaultOwner and defaultRepo and pass the issue/PR number as threadId.

Import it from:

ts
import { GithubMessagingProvider } from "@lssm-tech/integration.provider-messaging/impls/messaging-github";
ts
const github = new GithubMessagingProvider({
	token: process.env.GITHUB_TOKEN!,
	defaultOwner: "lssm-tech",
	defaultRepo: "contractspec",
});

await github.sendMessage({
	threadId: "42",
	text: "ContractSpec automation result",
});

For repository, issue, pull request, merge, and code-search operations, use @lssm-tech/integration.provider-github. For inbound GitHub webhook requests, verify signatures and normalize channel events through @lssm-tech/integration.runtime/channel/github or the webhook receiver in @lssm-tech/integration.runtime/webhooks/github. Keep personal access tokens, GitHub App installation tokens, private keys, and webhook secrets in managed secrets; test fixtures should use redacted placeholders and mocked fetch responses only.

Matrice

MatrixMessagingProvider is a minimal matrix-js-sdk adapter for Matrix room sends and mocked room-event normalization. It expects an existing homeserver URL and access token; it does not provision homeservers, automate hosted signup, install bridges, guarantee production bridge operation, or replace direct Slack/Telegram/WhatsApp providers.

Import it from:

ts
import { MatrixMessagingProvider } from "@lssm-tech/integration.provider-messaging/impls/messaging-matrix";

Personal device channels

The ./personal-device-bridge subpath models the owner's personal WhatsApp account and Android SMS inbox as personal-mode channels, separate from the official business adapters above. A binding carries its own consent, an explicit coverage start and read_only access by default. A device companion implements PersonalDeviceBridgePort; PersonalDeviceRegistry pairs it with a one-time code, tracks heartbeat/offline/revoked state and projects a per-capability matrix (unsupported, disabled, unqualified, qualified). SMS never implies RCS, and nothing is inferred from OAuth or business profiles.

No qualified device transport ships today: without one the channel reports unsupported and blocked, and the fixture transport is deliberately unqualified. catchUpPersonalDevice is read-only (cursor + sequence replay protection, missing media reported as missingEvidence, owner-sent messages as message.sent_by_owner). sendPersonalMessage requires a qualified, consented, read_write, online binding and the owner_personal audience; ambiguous sends stay uncertain. Business credential factories refuse personal credentials via isPersonalChannelCredential.

Declared capabilities.

Integration Provider Messaging

Messaging provider implementations for ContractSpec.

Use it to

  • Adopt messaging provider implementations for contractspec

Requires

  • TypeScript

Choose another boundary when

  • The @lssm-tech/integration.provider-messaging package constraints do not match the target runtime or platform.

@lssm-tech/integration.provider-messaging

@lssm-tech/integration.provider-messaging/discord-bot-ecosystem-adapter

@lssm-tech/integration.provider-messaging/ecosystem-adapters

@lssm-tech/integration.provider-messaging/impls

@lssm-tech/integration.provider-messaging/impls/messaging-github

@lssm-tech/integration.provider-messaging/impls/messaging-matrix

@lssm-tech/integration.provider-messaging/impls/messaging-slack

@lssm-tech/integration.provider-messaging/impls/messaging-teams

@lssm-tech/integration.provider-messaging/impls/messaging-telegram

@lssm-tech/integration.provider-messaging/impls/messaging-whatsapp-meta

@lssm-tech/integration.provider-messaging/impls/messaging-whatsapp-twilio

@lssm-tech/integration.provider-messaging/messaging

@lssm-tech/integration.provider-messaging/meta-whatsapp-ecosystem-adapter

@lssm-tech/integration.provider-messaging/personal-device-bridge

Imports and export paths.

27 entries

These are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.

27 imports

Dependencies and related packages.

Runtime dependencies 7
jose
^6.2.12
matrix-js-sdk
catalog:integrations
Development dependencies 4
@types/bun
catalog:types
typescript
catalog:

Package scripts.

Commands declared by this package. Review its setup requirements before running them; no command here was executed by this review.

buildcontractspec-bun-build build
build:bundlecontractspec-bun-build transpile
build:typescontractspec-bun-build types
devcontractspec-bun-build dev
cleanrimraf dist .turbo
lint:checknode ../../../scripts/biome.cjs check .
lint:fixnode ../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../scripts/biome.cjs check --write .
testbun test
prebuildcontractspec-bun-build prebuild
typechecktsgo --noEmit
Votre vue

Make room for your context.

Shape the presentation around this moment. You can change it whenever you need.

Votre contexte

The different parts of you

Choose a starting point

Un mélange utile de contexte, de visuels et de guidage discret.

Tune each dimension
Each dimension can change independently. Product permissions and available actions stay unchanged.

Support the way you begin and return

Tune your support

Confort de lecture

Choisir votre langue

La langue de l’interface change uniquement le texte. Les marchés, les prix et les parcours conservent leurs propres paramètres.

Couverture des traductions

Une partie du contenu est affichée en anglais.

Navigation151
Graphe616
Catégories378
Portfolio833
Exemples2 035
Aperçu de la source1 542

D’autres traductions seront ajoutées à mesure que le contenu sera relu.

Cette préférence est enregistrée dans ce navigateur.

Rechercher sur le site

Des points de départ utiles

Aucun résultat. Essayez une expression plus courte, un nom d’opération ou un autre périmètre de recherche.

UN PEU DE PLACE POUR EXPLORER

Trouvez quelque chose à explorer.

Ouvrez un aperçu détaillé sur cette page, essayez une autre perspective ou suivez le détail vers sa propre page.

Fonctionnement des aperçus et des commandes
01

Regarder avant de partir

Survolez un lien ou sélectionnez-le avec Tab pour voir un aperçu. Cliquer sur le lien d’origine ou appuyer sur Entrée ouvre toujours sa destination.

02

Rester dans le contexte

Entrez dans l’aperçu pour explorer ses sections. Depuis un lien sélectionné, utilisez Alt + ↓ pour y entrer au clavier. Échap le ferme.

03

Ouvrir les possibilités

Les lignes dépliables, les choix de perspective et les commandes mises en évidence révèlent davantage. Votre vue adapte le confort de lecture et le contexte exploré.

Un bouton séparé pour voir de plus près

Affichez de petits boutons d’aperçu à côté des liens quand l’espace le permet. Touchez l’œil pour examiner ou le lien pour y aller directement. Ce choix reste dans cet onglet.

Aucun historique de navigation n’est collecté. La réduction des animations suit votre appareil et Votre vue.